Installation and activation
To topAfter you have installed the Borlabs Cookie WordPress plugin, you can find it under Settings > Borlabs Cookie. To set the plugin up and running, two steps are necessary:
- Make sure the checkbox Activate Borlabs Cookie in the Settings > Status tab is checked.
- Integrate some form of tracking (Google Analytics, Facebook Pixel, other solutions) by entering the tracking ID(s) or JavaScript code into the appropriate fields under Cookie option 1: Third-party cookies or Cookie option 2: First-party cookies (detailed explanation below).
If these steps were successful, the cookie selection box will be displayed when you visit the website.
Paste Shortcodes
To topThen you should set the shortcode [[borlabs_cookie]] so that the visitor can change the selection at any time. We recommend the privacy page of your website.
You can use the following shortcodes to give the visitor the possibility to opt-out of Google Analytics and Facebook Pixel.
- Shortcode [[borlabs_cookie_opt_out tracking="google-analytics"]] gives the visitor the possibility to opt-out of Google Analytics
- Shortcode [[borlabs_cookie_opt_out tracking="facebook-pixel"]] gives the visitor the possibility to opt-out of Facebook Pixel
The opt-out options can also be added to a button or link via the CSS classes borlabs-cookie-google-opt-out and borlabs-cookie-facebook-opt-out.
Example:
<a class="borlabs-cookie-google-opt-out">Click here to opt-out</a>
Use Google opt-out with your own Google Analytics Code or Google Tag Manager
To topIf you do not integrate Google Analytics through our integrated solution, you can use the opt-out feature of Borlabs Cookie by inserting your tracking ID in the shortcode or link.
Example Shortcode
[[borlabs_cookie_opt_out tracking="google-analytics" id="yourTrackingID"]]
Example HTML
<a class="borlabs-cookie-google-opt-out" data-borlabs-cookie-tracking-id="yourTrackingID">Click here to opt-out</a>
How do I integrate a form of tracking?
To topBorlabs Cookie distinguishes between Third-party and First-party cookies. In most cases you can ignore First-party cookies, as this field is only necessary for you if you use e.g. tracking code of a self-hosted Piwik/Matomo. In all other cases, only the fields under Third-party cookies are relevant to you. Once you have entered and saved your code or tracking IDs in the corresponding fields, tracking is integrated via Borlabs Cookie and the user receives the cookie selection box.
Borlabs Cookie only blocks JavaScript that is stored in the Borlabs Cookie backend or masked by the shortcodes provided by Borlabs Cookie. JavaScript code stored in the backend is placed at the end in the footer of the website.
Cookie option 1: Third-party cookies
This concerns Google Analytics and Facebook Pixel, but also Google Adsense and Google Tag Manager, as well as all other third party cookies.
Google Analytics user
If you want to use Google Analytics, make sure you remove any previously used code for Google Analytics. Enter your tracking ID in the Google Analytics Tracking-ID field under Cookie option 1: Third-party cookies, save and Borlabs Cookie will now automatically implement the appropriate code, including IP anonymization (the anonymizeIp parameter is enabled by default).
If you integrate Google Analytics via the Google Tag Manager, the field Google Analytics Tracking-ID must be empty.
Facebook Pixel user
Enter your tracking ID in the Facebook Pixel-ID field under Cookie option 1: Third-party cookies, save and Borlabs Cookie will now automatically implement the appropriate code.
You can find your Facebook Pixel-ID here: https://www.facebook.com/ads/manager/pixel
Other Third-Party cookies
If you use other code like Google Adsense or Google Tag Manager, enter it in the field Your JavaScript including <script> tags under Cookie option 1: Third-party cookies.
If you integrate Google Analytics via Google Tag Manager, the field Google Analytics Tracking-ID must be empty.
Example for Google Adsense
<script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <script> (adsbygoogle = window.adsbygoogle || []).push({ google_ad_client: "ca-pub-123456789", enable_page_level_ads: true }); </script>
The following code is entered at the position where the corresponding banner is to appear:
[[borlabs_cookie_third_party] <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> [/borlabs_cookie_third_party]]
Using the [[borlabs_cookie_third_party]] or [[borlabs_cookie_first_party]] shortcodes also displays the cookie selection box, even if all fields under Third-party and First-party cookies are empty.
How do I customize the options in the cookie selection box?
To topIf you want to change the displayed text, you can do this under the Texts tab. If you want to limit the options of the cookie selection box to two instead of three, follow this instruction: https://borlabs.io/kb/how-can-i-limit-the-options-shown-in-the-cookie-selection/
How can I check if the setup worked?
To topTo verify that Borlabs Cookie has been successfully set up, we recommend the tool Ghostery. You can find out how to set up the tool and check your page in the article: How can I check if the setup worked?
Further options
To topBlock content before selection
The Cookie box blocked xontent option can be used to prevent visitors from accessing the content of the page as long as they have not selected a cookie selection box option.
Show cookie box
With the Show cookie box option set to Automatic the cookie box only displays if you have inserted at least one JavaScript code in the above fields, entered a Google Analytics tracking ID or a Facebook pixel ID.
With the Show cookie box option set to Always, you can always display the cookie box, even if you have not entered any code or short code. This is only useful in very rare cases and should therefore remain deactivated.
With the Show cookie box option set to Never, the cookie box will not be displayed.
Block special content
With the shortcode [[borlabs_cookie_blocked_content title="Your title"]] Your blocked content[/borlabs_cookie_blocked_content]] you can block any content, similar to iframes. This function is not bound to one of the selectable options of the cookie selection box - but this can be activated optionally if required (including all iframes). See Automatically reload blocked content below.
Example:
[[borlabs_cookie_blocked_content title="EIN BILD"]<p>It worked!</p><img class="aligncenter size-full wp-image-2233" src="https://borlabs.io/wp-content/uploads/sites/2/2018/02/knowledge-borlabs-cookie.png" alt="" width="256" height="256" />[/borlabs_cookie_blocked_content]]
Result:
[borlabs_cookie_blocked_content title="EIN BILD"]
It worked!
[/borlabs_cookie_blocked_content]
Exclude iframe from blocking
To topIf you do not want to block a special iframe, you can set the attribute data-borlabs-cookie-iframe-spared.
Example:
<iframe data-borlabs-cookie-iframe-spared width="100%" height="300" scrolling="no" frameborder="no" allow="autoplay" src="https://meinewebsite.com/wetterwidget"></iframe>
Automatically reload blocked content
To topIf you want to automatically reload all content that is actually loaded by a click of the user, you can do this with the command
window.BorlabsCookie.unblockAllContent("all");.
It is possible to combine this with an option of the cookie selection box. Insert the following code in the field Your JavaScript including <script> tags under Third-party cookies:
<script>window.BorlabsCookie.unblockAllContent("all");</script>