GDPR 2.0 - Extend GTM Support

Hi,

I am using BeTheme’s built-in GDPR 2.0 / Google Consent Mode popup together with Google Tag Manager.

The theme appears to handle the Google consent update itself, which is good. From the theme script, I can see that when saved consent exists, BeTheme reads the mfnConsent cookie and calls:

gtag('consent', 'update', consents);

When the visitor accepts all, selects specific categories or denies consent, BeTheme also updates consent through:

gtag('consent', 'update', consents);

then saves the mfnConsent cookie and closes the popup.

However, as far as I can tell, BeTheme does not currently push a GTM-compatible dataLayer event when consent is updated. It does trigger a jQuery event after the popup closes:

$(document).trigger('mfn:gdpr2:close');

but Google Tag Manager cannot use that directly as a Custom Event trigger.

This creates a practical issue for GTM setups.

For example, if a Google Tag or GA4 page_view tag is blocked on the initial page load because analytics consent is denied, the tag does not automatically fire later when the visitor gives consent. On the next page reload, everything works because the mfnConsent cookie has been saved and BeTheme updates the consent state on page load.

The missing scenario is:

  1. A visitor lands on the site for the first time.
  2. Consent defaults to denied.
  3. GTM evaluates the GA4 / Google tags and blocks them because consent has not yet been granted.
  4. The visitor accepts analytics consent using the BeTheme popup.
  5. BeTheme correctly updates Google consent, but GTM has no dataLayer event to trigger the relevant tags immediately.
  6. The first page view is therefore missed unless the visitor reloads or visits another page.

This can be worked around with a custom script listening for BeTheme’s popup buttons or the mfn:gdpr2:close jQuery event, then pushing a dataLayer event manually. However, it would be cleaner and more reliable if BeTheme exposed this natively.

Would you consider adding a dataLayer.push() event inside the BeTheme consent update flow, ideally inside consent.set() immediately after:

gtag('consent', 'update', consents);

For example:

window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
  event: 'mfn_consent_update',
  mfn_consent: consents,
  analytics_storage: consents.analytics_storage,
  ad_storage: consents.ad_storage,
  ad_user_data: consents.ad_user_data,
  ad_personalization: consents.ad_personalization
});

This would allow Google Tag Manager users to create a Custom Event trigger for mfn_consent_update and fire permitted tags immediately after consent is granted, without needing a page reload or custom bridge script.

It would also make BeTheme’s Consent Mode integration much easier to use in a GTM setup, especially now that many Google tags are managed through GTM rather than being placed directly in the theme options.

Thanks.

Comments

  • Hi,

    I have passed it on to the dev team, and I was informed that we will introduce your suggestions in upcoming updates.


    Best regards

  • Brilliant, that's great.

    Please support this with a documentation page somewhere that will ensure the correct triggers can be set up in GTM.

Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.