How to associate site tracking to Contact

Hi all,

Question: Using the tracking code, should it be possible to associate site tracking to a Contact that has already been created in ActiveCampaign? I ask as it doesn’t seem to be working for me.

I’ve added the tracking code to my site and modified it slightly to include the email address (with cookie consent) as a parameter.

For example, the standard tracking code includes the following;

pgo('setAccount', 'XXXXXXXXX');
pgo('setTrackByDefault', true);
pgo('process');

A php script injects the email pgo parameter for email address in to the tracking snippet. This is the same email address used to register the Contact with AC.

pgo('setEmail', 'example@email.com');
pgo('setAccount', 'XXXXXXXXX');
pgo('setTrackByDefault', true);
pgo('process');

I would expect AC to check the email parameter, locate the Contact and register the site activity against that Contact. However, I’m not seeing any site tracking information in the Contact details information page.

Can anyone shed some light on the reasons why this could be?

Thank you

1 Like

Update, by changing the sequence of parameters to

pgo(‘setAccount’, ‘XXXXXXXXX’);
pgo(‘setTrackByDefault’, true);
pgo(‘setEmail’, ‘example@email.com’);
pgo(‘process’);

Seems to have fixed the issues. This makes no sense to me but hey, if it now works I’m happy. Just thought I’d update this thread should it help anyone else.

1 Like

I have posted a variation to this question here:
How to associate site tracking to Contact (After Instantiation)
…for those who need to provide the email address after the script is already running.
Thanks - John