Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1484714

    Hi,
    I would like to install the Google Tag Manager. Therefore I have two instructions. (1. Insert this code as high up as possible in the <head> of the page. 2. Also, insert this code directly after the opening <body> tag:) I have read the other threads on this, but still don’t know my way around. If I understand it correctly, I add the code under Google Services > Google Measurement ID (Google Analytics Tracking Code). Does this apply to both paragraphs?
    Kind regards,
    ebenanders

    #1484720

    Hey ebenanders,

    Please try this in your child theme functions.php file:

    
    function ebenanders_add_gmt(){
    ?>
      YOUR CODE GOES HERE
    <?php
    }
    add_action('ava_after_body_opening_tag', 'ebenanders_add_gmt');

    Best regards,
    Rikard

    #1484726

    Hi Rikard,
    thank you for your help! Please provide further assistance: The Editor field does not exist on this website, how can that be?
    Kind regards,
    Karin

    #1484745

    Hi,

    If you have questions outside the current topic, then please open a new thread.

    Best regards,
    Rikard

    #1485281

    Hi,
    With my editor field finally back, I´m not sure where exactly to insert the code. (No coding scills) Please take a look at the screenshot and the code, is that right? The instruction is: “Copy the code below and paste it on every page of your website. Paste this code as high up as possible in the <head> of the page. or Paste this code directly after the opening <body> tag:”
    I now have both code blocks in a row, which is probably not correct, is that right?
    It irritates me that the code has to be inserted on every page.

    Thank you for your help!

    Best regards,
    ebenanders

    #1485299

    Hi,

    Try pasting the code on the second line in your screenshot.

    Best regards,
    Rikard

    #1485319

    Thank you Rikard!
    I’m waiting for the ok from the Google Ads agency and will get back to you when I know that it works!

    Best regards,
    ebenanders

    #1485321

    One more question: Do I need any hooks like “wp_head” or the “wp_footer” to render those snippets inside the head tag or after the body tag?

    #1485339

    Hi,

    ava_after_body_opening_tag is the hook being used in the code that you are using.

    Best regards,
    Rikard

    #1485362

    Hi Rikard,

    in the meantime, I have received feedback that everything is working, thank you so much!

    Best regards,
    ebenanders

    #1485368

    Hi,

    Thanks for the update, we’ll close this thread for now then. Please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Google Tag Manager installieren’ is closed to new replies.