Archived topic
Body tag location
16 replies · Started by Aun Raza on August 15, 2015
Hello Tom
I'm using generatpress on my site linuxpitstop.com, I have signed up for a pop under ad with some ad network. They gave me code to put before the body tag. I can't locate whats the correct file to place this code. Where is body tag located (i mean in which file) ?
Thank you!
Regards
Aun
Do you have GP Premium or GP Hooks?
If so, you can place your code in the wp_head hook.
Let me know :)
Thanks for prompt response Tom
I have GP Premium - which file i should be using in this case?
Regards
Aun
First, make sure GP Hooks as activated in "Appearance > GeneratePress".
Then, go to "Appearance > GP Hooks" and place your code into the wp_head textarea.
Hi Tom,
I will take the liberty to use the already opened "ticket" to add my question.
Can I place my Google Tag Manager snippet there too? The instructions say to place it immediately after the opening <body> tag. Thanks.
Best regards,
Dimitar
Hi Dimitar. The "Before Header" hook will insert it right after the opening <body> tag.
Thank you. Unfortunately placing it there did not do the job. I have placed the Google Analytics tracking code there too and still see 'Status: Tracking Not Installed'.
I believe both of the above scripts should go in the wp_head hook.
I've tried this, but it produces an empty line under the menu bar... is there any other way of including it? Thanks!
PS. still loving the theme!
What are you adding?
Google call conversion tracking
Adding it to the wp_head hook shouldn't create any spacing.
Any examples of the code you're adding?
Hi,
I am having the same issue - putting the code for both my Google Analytics code (currently in my site without issue) and my new Retargeting Pixel code to the wp_head hook is adding a blank line and forcing my header image down.
See screenshot of site with both codes included in wp_head, red arrow pointing to blank line: https://tinyurl.com/zcqvc6e
See the code I put in the wp_head hook: https://tinyurl.com/hwxuz7f
Same blank line occurs if I put the Retargeting Pixel code in Before Header hook
The instructions for the Retargeting Pixel I received for implementation: The entire HTML pixel code, from , should be placed unaltered directly after the opening <body> tag. **Disclaimer: never edit the code
Where to put the Retargeting Pixel code so it doesn't insert a blank line?
Hard to tell without seeing the site, but try adding this to your <img> element: style="display:none;"
<img style="display:none" ... />
Thank you, I will contact the marketing company and verify that I can put this in.