• Resolved ridgeroad11

    (@ridgeroad11)


    Hello,

    Google gives with one code for both Marketing and Analytics cookies.

    Therefore I have followed this thread and tried to implement a HTML ID which is added to the HEAD, BODY and/or FOOTER elements when, for example, only analytics is enabled.

    The code I used is:
    <id="analytics_enabled">

    In the GTM preview I see this

    Click Accept Analytics
    Filters
    HTML ID contains analytics_enabled
    _event equals Analytics Enabled

    I suspect I am doing something wrong in my code which is why my tag isn’t currently triggering.

    Any help would be greatly appreciated.

    Thanks,
    Daniel

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Moove Agency

    (@mooveagency)

    Hello @ridgeroad11,

    Thanks for using our plugins.

    The code you are using is not correct, you can try something like:
    <div id="analytics_enabled"></div>

    If the fix above doesn’t fix the issue, you can try to enable the force reload on accept and add the HTML element using PHP checker:

    add_action( 'gdpr_force_reload', '__return_true' );

    add_action('wp_footer','gdpr_gtm_check_sample');
    function gdpr_gtm_check_sample() {
      if ( function_exists( 'gdpr_cookie_is_accepted' ) ) {
        if ( gdpr_cookie_is_accepted( 'thirdparty' ) ) {
          ?>
            <div id="analytics_enabled"></div>
          <?php
        }
      }

    Hope this helps

Viewing 1 replies (of 1 total)
  • The topic ‘Separating Marketing and Analytics with GTM’ is closed to new replies.