Site logo

[Support request] tracking pixel

Home Forums Support [Support request] tracking pixel

Home Forums Support tracking pixel

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #641843
    Gary L

    Hi,
    I need to place a tracking pixel on one page only.
    The tracking pixel comes in javascript or html
    Do I need a GPhook for this or can I put it in the text editor of the page and it will stay there?

    Or what is the best way?

    Thanks

    #641847
    Leo
    Staff
    Customer Support
    #641868
    Gary L

    Hi,
    I saw that post earlier, I’m not sure how to do a hook for one post only. Isn’t the GPhooks under Appearance sitewide? Or does the code from the page you just showed me signify what page the hook goes to?

    I looked at the post page I need to place the tracking pixel. I don’t see a place to insert a GPhook.

    Thanks

    #641872
    Gary L

    Oh, I think I see…where it says page slug here…that would do it, right?

    #641879
    Leo
    Staff
    Customer Support

    Yup exactly.

    More info here: https://docs.generatepress.com/article/using-hooks-conditional-tags/

    Thought I should mention that starting in GP premium 1.7 (currently in release candidate 2 so we think it’s really stable), the new Hooks element module will replace the need for writing code:
    https://docs.generatepress.com/article/hooks-element-overview/#display-rules

    You can become a beta tester here:
    https://docs.generatepress.com/article/beta-testing/

    #641902
    Gary L

    Hi,

    Ok that did the trick, I’ll keep it in mind about the new beta when I get a bit more time.
    I have another tracking pixel for engagements that goes on 3 other pages, (same pixel)

    in the php code 1st line:

    php if ( is_page( ‘page-slug-here’ )

    do you seperate by comma or I need to do code for each page slug?

    php if ( is_page( ‘1,2,3’ )

    Thanks

    #641908
    Leo
    Staff
    Customer Support
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.