Setting up Borlabs Cookie

Setting up Borlabs Cookie

You are here:
Estimated reading time: 5 min

Installation and activation

To top
Please disable your caching plugins while setting up Borlabs Cookie. You can then reactivate them.

After 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:

  1. Make sure the checkbox Activate Borlabs Cookie in the Settings > Status tab is checked.
  2. 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.

To ensure the function of Borlabs Cookie, plugins that were previously used to integrate Google Analytics and Facebook Pixel must be deactivated!

Paste Shortcodes

To top

Then 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
Note: The opt-out of Google Analytics and Facebook Pixel is independent of the cookie selection box, i.e. a choice of option 2 of the cookie selection does not trigger an opt-out.

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 top

If 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>
This is not possible with Facebook Pixel for technical reasons, so use our integrated solution.

How do I integrate a form of tracking?

To top

Borlabs 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 top

If 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 top

To 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 top

Block 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://de.borlabs.io/wp-content/uploads/sites/2/2018/02/knowledge-borlabs-cookie.png" alt="" width="256" height="256" />[/borlabs_cookie_blocked_content]

Result:

Click on the button below to load the content of EIN BILD.
Load content

PC9wPgo8cD5JdCB3b3JrZWQhPC9wPgo8cD48aW1nIGNsYXNzPSJhbGlnbmNlbnRlciBzaXplLWZ1bGwgd3AtaW1hZ2UtMjIzMyIgc3JjPSJodHRwczovL2RlLmJvcmxhYnMuaW8vd3AtY29udGVudC91cGxvYWRzL3NpdGVzLzIvMjAxOC8wMi9rbm93bGVkZ2UtYm9ybGFicy1jb29raWUucG5nIiBhbHQ9IiIgd2lkdGg9IjI1NiIgaGVpZ2h0PSIyNTYiIC8+PC9wPgo8cD4=

Exclude iframe from blocking

To top

If 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 top

If you want to automatically reload all content that is actually loaded by a click of the user, you can do this with the command
$jBC.BorlabsCookie.unblockAllContent();.

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();</script>
Was this article helpful?
Dislike 0
Views: 159

Cookie Preference

Please choose an option. You can find more information about the consequences of your choice via Help. Privacy Policy | Imprint

Select an option to continue

Your selection was saved!

Help

Help

To continue, you must make a cookie selection. Below is an explanation of the different options and their meaning.

  • Accept all cookies:
    Every cookie like tracking and analytic cookies (Google Analytics).
  • Only allow necessary cookies:
    Only necessary cookies like the cookie of Paddle for the checkout.

You can change your cookie setting here anytime: Privacy Policy. Imprint.

Back