[Resolved] Install Site Tracking Code

Home Forums Support [Resolved] Install Site Tracking Code

Home Forums Support Install Site Tracking Code

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1972233
    John

    Hello GeneratePress Help !

    It’s been a while. Because everything is going so well with my site. Thank you !

    I have signed up to ActiveCampaign. I want to enable site tracking. ActiveCampaign tells me that I need to install site tracking on my site. They provide a code which I am supposed to add to the footer of each page I want tracked. Well, I have far too many pages in order to do that manually.

    Here is a link to their explanation: https://help.activecampaign.com/hc/en-us/articles/221493708-How-to-set-up-Site-Tracking#how-to-turn-on-site-tracking-and-whitelist-domains

    Is there a way to add the site tracking code in one spot which will cover the entire site?

    John Magee

    #1972234
    Leo
    Staff
    Customer Support

    Hi there,

    A hook element:
    https://docs.generatepress.com/article/hooks-element-overview/

    With the wp_footer hook should be what you are looking for:
    https://docs.generatepress.com/article/wp_footer/

    Hope this helps.

    #1972955
    John

    That was fast, Leo. Thank you !

    I’m not sure if I got it right with creating a hook, because this appeared after “Execute PHP”:
    “Unable to execute PHP as DISALLOW_FILE_EDIT is defined.”

    If that is a problem, would it help if I gave you access to my WP-site?

    Here is the tracking code from ActiveCampaign that I am supposed to embed on all pages:

    <script type=”text/javascript”>
    (function(e,t,o,n,p,r,i){e.visitorGlobalObjectAlias=n;e[e.visitorGlobalObjectAlias]=e[e.visitorGlobalObjectAlias]||function(){(e[e.visitorGlobalObjectAlias].q=e[e.visitorGlobalObjectAlias].q||[]).push(arguments)};e[e.visitorGlobalObjectAlias].l=(new Date).getTime();r=t.createElement(“script”);r.src=o;r.async=true;i=t.getElementsByTagName(“script”)[0];i.parentNode.insertBefore(r,i)})(window,document,”https://diffuser-cdn.app-us1.com/diffuser/diffuser.js&#8221;,”vgo”);
    vgo(‘setAccount’, ‘27184010’);
    vgo(‘setTrackByDefault’, true);

    vgo(‘process’);
    </script>

    John

    #1972996
    Ying
    Staff
    Customer Support

    Hi John,

    This article should be helpful:
    https://docs.generatepress.com/article/disallow-php-execution/

    #1973051
    John

    Super fast and super helpful, Ying. Thank you.

    But wait, did I understand the article that “Unable to execute PHP as DISALLOW_FILE_EDIT is defined.” is a good thing, because it is an extra layer of security?

    John

    #1973059
    Leo
    Staff
    Customer Support
    #1973107
    John

    But do I want to overwrite PHP as DISALLOW_FILE_EDIT?

    John

    #1973181
    Ying
    Staff
    Customer Support

    Leo’s snippet allows your site to execute PHP inside hook elements.

    I think it’s a better solution in your case.

    #1973340
    John

    Hi Ying,

    Ok, I entered the snippet which Leo had recommended. And I think I did it correctly. Thank you !

    John

    #1973814
    Ying
    Staff
    Customer Support

    No problem 🙂

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.