• i am using the child theme OceanWP. How do i install the google tag manager into my header and body? I only have style.css and functions.php in my editor. Thanks

Viewing 15 replies - 1 through 15 (of 21 total)
  • Hello, use Insert Header and Footer plugin.

    Thread Starter nichere

    (@nichere)

    thanks and for the body ?

    Thread Starter nichere

    (@nichere)

    or how can i get it inside the editor ?

    You need to only place code in the Head section of your site for Google Tag Manager.

    If you also want to add code in the body section. Go to editor > and select header.php file. Add your code here within the body.

    Thread Starter nichere

    (@nichere)

    ok Thanks Amit

    Thread Starter nichere

    (@nichere)

    I dont have header.php in the editor i only have finctions.php ( i added the script there and it gave me an error. it doesnt make sense that i would add a script for the body but enter it into the header.php ?

    Hello,

    Please read the guide here – Google tag manager

    If you will open header.php file then you will find body tag in it.

    You need to copy header.php file in your child theme to make any change.

    Thread Starter nichere

    (@nichere)

    I dont have a header.php as mentioned in my opening question. I have added that plug in header and footer. But i need to add the script to the body.

    How about this then….how can i add a header.php to the editor ?

    You can add your code in the body section by the following method.

    1) Header.php file located in the OceanWP parent theme. Copy this file and paste it in your child theme.
    Now go to editor and add code after the body tag.

    2) go to appearance > widget > sidebar widget.
    Add your code in this sidebar widget using custom HTML widget.

    Thread Starter nichere

    (@nichere)

    now trying via cpanel

    Thread Starter nichere

    (@nichere)

    I am using the child version. This is why it doesnt enable access to the header.php

    do i need to modify in the Oceanwp theme or the child theme ?

    Please follow the above mentioned steps.

    Thread Starter nichere

    (@nichere)

    ok,,,do i paste the header.php into the functions.php of the child theme ?

    No, just copy the header.php file and paste it into your child theme folder along with the function.php file.

    Now use an editor to open it and add your code.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Inserting Google tag manager’ is closed to new replies.