What is dataLayers and how to use it to integrate with the Consentmo app

Integrations

5 mins

Dilyana Simeonova
September 22, 2022

Understanding DataLayers: A Guide to Integration with Consentmo

Even if it sounds complicated, dataLayers are very simple - it is a JavaScript object, whose job is to gather data, that can later be used for other tools utilized on the site. Let's see how and for what the Consentmo app uses the dataLayers.

Integrating with the Consentmo  app

The dataLayer used for the Consentmo app gives other apps that want to integrate with it information about the consent settings of the customers. This can be done by checking the consent_status entry in the dataLayer variable. The consent_status entry contains the property's status and categories. The "status" property indicates the state of the client's cookie preferences. That state can be allow, or decline.

"Allow" is set when both the Analytics and Marketing cookie categories are not blocked. This status will be set if the cookies are not blocked before and/or after the client interacts with the Cookie bar.

"Decline" is set when the Analytics, Marketing, or both cookie categories are blocked. This status will be set if the cookies are blocked before and/or after the client interacts with the Cookie bar.

The "category" property contains information that shows if each of our app's cookie categories are blocked or accepted.

In this screenshot, we see that all cookie categories are accepted from their state being set to true.

If a client is located outside of the region our app is enabled for, he will not be seeing the Cookie bar. Therefore the "status" property will automatically be set to allow and the cookie categories will be set to true indicating that they are not blocked.

And this is all of the information regarding the dataLayers of the Consentmo app. To keep yourself up to date on all of the ways to be compliant, follow us on our social media channels, and for questions, don't hesitate to contact us via chat or email, or simply check our FAQ page.

If you liked this article, spread the word

Stay informed

Sign up for our newsletter to get the latest updates, thoughts, and ideas from Consentmo.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Is your site compliant?

Your Guide to Launching a Successful Shopify Business

Discover the essentials of launching a thriving Shopify business in our new e-book

Download