Community Forums › Forums › Archived Forums › General Discussion › Insert Tracking Code into WordPress Website?
Tagged: tracking code
- This topic has 10 replies, 3 voices, and was last updated 5 years, 2 months ago by RavenManiac.
-
AuthorPosts
-
July 19, 2018 at 9:00 pm #221838RavenManiacParticipant
One of my clients is using a company that does targeted Internet advertising. I have been asked to place the following code between the body tags in my client's home page:
What's the best way to do this?
July 19, 2018 at 10:12 pm #221841Victor FontModeratorThe easiest way is with the Genesis Simple Hooks plugin. Insert your code into the genesis_before hook. This hook executes immediately after the opening body tag.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?July 19, 2018 at 10:17 pm #221843RavenManiacParticipantThanks Victor. I'll give it a go.
July 21, 2018 at 3:38 pm #221899RavenManiacParticipantHi Victor,
I ended up using the hooks feature within Genesis Extender, a plugin I'm already using, which worked great! Thanks again for your help.
BTW, where is the best place to learn about hooks and what they do?
July 22, 2018 at 6:27 pm #221919Rainmaker2018MemberI do like this site for tutorials on how to use the extender. there are plenty out there though.
July 23, 2018 at 4:00 am #221925Victor FontModeratorTonya Mork from https://knowthecode.io has some awesome tutorials on WordPress hooks (actions and filters). Understanding WordPress hooks is essential for a WordPress developer.
Here is a site I like: http://genesis.wp-a2z.org/
It lists Genesis actions and filters and where you can find them in the source. Whomever manages that site has been pretty diligent in keeping it up to date.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?February 4, 2019 at 11:58 am #489293RavenManiacParticipantThis reply has been marked as private.February 4, 2019 at 1:22 pm #489294Victor FontModeratorIt is the iframe causing the problem. I don't know why they would use an iframe for this. All it's doing is calling a url that in turn loads 5 tracking pixels.
You can try adding a class to the iframe and setting the class to display: none;. I don't think that will prevent the tracking pixels from loading, but it might. If it does, tray adding a margin-top: -30px to site-container.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?February 4, 2019 at 1:42 pm #489296RavenManiacParticipantThanks, Victor. I appreciate your help. Out of curiosity, and I clearly don't have a clue, how is a tracking script normally inserted into a website? Does it require a container?
Thanks!
February 4, 2019 at 4:21 pm #489299Victor FontModeratorTracking scripts are normally inserted into the header or footer. With Genesis, you would use the header or footer script fields on the theme settings page if the script applies to the entire site.
I would never put scripts like that in the HTML section.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?February 4, 2019 at 7:57 pm #489302RavenManiacParticipantFor some reason, when I placed the pixel code in the Genesis header field in the theme settings page, I received several console errors. But, surprisingly, when I inserted it into the same area using Extender Pro and a Header hook everything seems to be working fine.
Not sure why one method would work and the other wouldn't unless it has to do where the script is being placed within the header. Thanks again for your help.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.