Home Forums Basel support forum Google Tag Manager

Google Tag Manager

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #13414

    Giulio
    Participant

    Hi there,

    I’d to insert Google Tag Manager code inside body. Have I to add it inside header.php or style.css and how?

    Thank you!

    #13438

    Artem Temos
    Keymaster

    Hi,

    We suggest you to use this plugin to add any code to header or footer https://wordpress.org/plugins/insert-headers-and-footers/

    Regards

    #13440

    Giulio
    Participant

    I’d like, but we already use many plugins for WooCommerce. Please could you suggest a way to insert without a plugin?

    #13446

    Artem Temos
    Keymaster

    Then, you can add it to the header.php or footer.php

    #13447

    Giulio
    Participant

    How I can add it here?

    <body <?php body_class(); ?>>

    #13449

    Artem Temos
    Keymaster

    Just place your code there, before or after this tag.

    #13452

    Giulio
    Participant

    As this?

    <body <?php body_class(); ?>>
    
    <!-- Google Tag Manager (noscript) -->
    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-*******"
    height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    <!-- End Google Tag Manager (noscript) -->
    
    <?php if (basel_needs_header()): ?>
    	<?php do_action( 'basel_after_body_open' ); ?>
    #13455

    Artem Temos
    Keymaster

    Yes, you can do in this way.

Viewing 8 posts - 1 through 8 (of 8 total)