• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Insert Tracking Code into WordPress Website?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Insert Tracking Code into WordPress Website?

This topic is: not resolved

Tagged: tracking code

  • This topic has 10 replies, 3 voices, and was last updated 6 years, 11 months ago by RavenManiac.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • July 19, 2018 at 9:00 pm #221838
    RavenManiac
    Participant

    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 #221841
    Victor Font
    Moderator

    The 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 #221843
    RavenManiac
    Participant

    Thanks Victor. I'll give it a go.

    July 21, 2018 at 3:38 pm #221899
    RavenManiac
    Participant

    Hi 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 #221919
    Rainmaker2018
    Member

    I do like this site for tutorials on how to use the extender. there are plenty out there though.

    Genesis Extender Tutorial


    James L – https://Inhomegolf.ca
    https://f45training.ca/whiteoaks

    July 23, 2018 at 4:00 am #221925
    Victor Font
    Moderator

    Tonya 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 #489293
    RavenManiac
    Participant
    This reply has been marked as private.
    February 4, 2019 at 1:22 pm #489294
    Victor Font
    Moderator

    It 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 #489296
    RavenManiac
    Participant

    Thanks, 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 #489299
    Victor Font
    Moderator

    Tracking 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 #489302
    RavenManiac
    Participant

    For 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.

  • Author
    Posts
Viewing 11 posts - 1 through 11 (of 11 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble