Site logo

Archived topic

Install Site Tracking Code

9 replies · Started by John on October 22, 2021

Viewing posts 1–10 of 10

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

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","vgo");
vgo('setAccount', '27184010');
vgo('setTrackByDefault', true);

vgo('process');
</script>

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

But do I want to overwrite PHP as DISALLOW_FILE_EDIT?

John

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

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

Hi Ying,

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

John

No problem :)

This archived topic is closed to new replies.