Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1359776

    hi we have a website, i want install google tag manager, I don’t know how to install.

    <head>

    <!– Google Tag Manager –>
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({‘gtm.start’:
    new Date().getTime(),event:’gtm.js’});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!=’dataLayer’?’&l=’+l:”;j.async=true;j.src=
    https://www.googletagmanager.com/gtm.js?id=’+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,’script’,’dataLayer’,’GTM-xxxxxxx’);</script>
    <!– End Google Tag Manager –>

    <body>
    <!– Google Tag Manager (noscript) –>
    <noscript><iframe src=”https://www.googletagmanager.com/ns.html?id=GTM-xxxxxx&#8221;
    height=”0″ width=”0″ style=”display:none;visibility:hidden”></iframe></noscript>
    <!– End Google Tag Manager (noscript) –>

    can help me?

    I didn’t use child themes (Demo Import)

    #1359788

    Best practice with any WordPress site is to install a child theme.
    Otherwise you will need a plugin to do this.
    You can either write your own plugin or use one like the example below from the wordpress plugin library – Sorry I just reworded this bit. It didnt make sense.

    You can download a plugin like this one instead: WP Headers and Footers

    If you use the built in Enfold Cookie popups – You must put your Google Tag Manager code into the Google Services Box in the Enfold Control Panel. Otherwise the cookie popups just wont work.

    If not you can just add everything using the plugin instead but this wont be compliant with GDPR because it will load unconditionally on every page.

    use the plugin to add your Body tag script on all pages in the body of the aritcle.

    Otherwise you can use the code below to insert the snipped from the functions.php file in your child theme or a custom plugin that mimics the functions file.

    
    // Add Google Tag code which is supposed to be placed after opening body tag.
    add_action( 'wp_body_open', 'tj_add_custom_body_open_code' );
     
    function tj_add_custom_body_open_code() {
        echo '
    INSERT YOUR GOOGLE BODY TAG HERE
    ';
    }
    
    • This reply was modified 2 years, 3 months ago by thinkjarvis.
    • This reply was modified 2 years, 3 months ago by thinkjarvis.
    • This reply was modified 2 years, 3 months ago by thinkjarvis.
    • This reply was modified 2 years, 3 months ago by thinkjarvis.
    #1359810

    Hi,

    Thanks for helping out @thinkjarvis :-)

    Best regards,
    Rikard

    #1360070

    Hi,
    thanks for your help.I have succeeded, used WP Headers and Footers plugin

    #1360088

    Hi strongpower123,

    We’re happy to hear that :)
    Thanks for using Enfold and have a great day!

    Best regards,
    Nikko

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘enfold google tag manager install’ is closed to new replies.