ActiveCampaign Forum

Pass Email to Site Tracking

So, right now I have the AC plugin installed on my Wordpress site and I have site tracking enabled and have a test form setup on a page via the shortcode. Everything works great.

BUT, we use Gravity Forms and I really don’t want to have to swap out all of our GF forms for AC forms to get site tracking to work.

Is there a way to pass the email to the site tracking script upon a GF form submission so that it can tie the site activity with that user? I have the Gravity Forms Active Campaign Add-On installed and am using that for one of my GF forms as well.

Any thoughts or advice would be greatly appreciated!

Hi @topleftcreative!

I found this piece of documentation for you from GF. This will help you create feeds from your existing GF forms that directly map to your new AC forms.

Is this what you were envisioning? Essentially, for Site Tracking to register actions, it must come through an AC form - this will help you achieve this.

Also, here is a piece of adding tag passing functionality as well if you want to take this integration to another level :).

Hi @Ted thank you for the info!

So, I think I found a solution. We are using the ActiveCampaign add on to bring the info of the submitted form into AC. What it wasn’t doing was passing the email address into the site tracking code to link that submission to the actual person’s browser.

So, here’s the PHP code that i put in my WordPress functions.php file that looks for the Gravity Forms field with a label of “Your Email” and saves it into a cookie. Then, the code that passes that cookie’s value to AC’s site tracking code.


Hey @topleftcreative!

Fantastic, glad you found a solution!

Thanks for sharing this @topleftcreative!

I was trying to find a non-code resolution for exactly this problem (albeit with JotForm and Unbounce) on this thread and looks like it isn’t possible.

Maybe I can try to use your code for JotForm, but might not work for Unbounce. Apparently, the API usage is the only way out. :frowning:

Hi All,

This is a great thread and something I think needs raising with in terms of overall traceability with AC.

I’m currently battling to integrate with AC to do exactly this type of thing - but to enrich the profile with other data, specifically sources, keywords and more from ad campaigns.

If anyone’s successfully done this - I’d love to hear it. (So would AC’s support team)


thanks for this tips, but I would like to do the exact contrary.
I mean passing the email adresse from the site tracking to my custom JS.
Is this possible ?

Tnx for the script @topleftcreative

But for some reason the cookie isn’t created with the gform add_filter fucntion in my situation.

When I simply set a cookie with an add_action ‘init’ function it’s created and added to the script correctly.

Any idea what the problem could be in my situation?

Hmm, I’m not sure. I’m using that exact code on numerous websites with success. One thing to note: the code looks for a field that has the label “Your Email” so you’ll need to change that in the Gravity Forms settings.

Sorry, your code works, but not with Varnish. Looking into other solution. Tnx!

Thanks for this code. I assume I could alter this slightly to use parmeters in the URL to link current browser profile to that paremeter?

Currently I am working on a way to send postcards / sms via zapier / lob / anveo that have individualized trackable links.

Since activecampaign has no way currently to create shortened trackable links that can be posted to the api my plan is the following. 1) Post out to a script running on my website the 1) link i want shortened and individualized 2) id of contact this link is individualize for 3) name of contact field to use as a temporary variable to store the shortened link in

The script will interface with my yourls link shortener to shorten my site yourl that has something in it like or and then it would shorten it to something looking like this and post back to the contact at the field i sugest.

I will set a timer to a couple minutes after this post out insert the agreed field into my API post out and then I can send out an SMS or postcard with these tracked links and potentially do very complex automations to people who I don’t even have an email address for. Possibly even only have an address for?

Has anyone allready done something like this before?

Does anyone have a sugestion for a better way to do this or is there funcitionality that allready allows something like this?

Hi StudioConnect did you ever find a solution to the ability to pass activecampaign contact data for current page to a custom JS?

It’s been 3.5 years - just wondering if anyone ever solved this?

Are you trying to solve the original post, or the subsequent goal of enriching a custom JS object with ActiveCampaign contact data?


I’m actually trying to get JotForm to dynamically pass an Email to ActiveCampaign once the user submits a JotForm, so that Site Tracking can begin immediately.

Any idea how I can do that?