Because when a user registers via API does not work site tracking

Because when a user registers via API does not work site tracking

Hey @marketingconresultad,

If you are registering a user via API, you will need to populate the trackcmp_email variable in javascript before calling the site tracking code.

Here’s an example on codepen -

https://codepen.io/jordanskole/pen/VzKmaV

3 Likes

FYI If your browser is setup for “Do Not Track” (DNT) ActiveCampaign honors that flag and the identify step doesn’t set the cookie. Also If you have third party cookies disabled it’s the same situation so check those if you’ve already followed Jordan’s example and it’s still not working.

@jskole It would be cool if someone added a warning in the docs. I know I submitted a support ticket and killed an hour before I figure this out.

1 Like

Hey Rob! Communicating that in help docs is a good idea.

Also, we might be revisiting our Do Not Track policy and behavior at some point. If you’d like to see it changed (we could stop honoring it or make it an optional setting) submit it to us as feedback so your input can be factored in.

Hi, i tried the solution bt @jskole and it worked for me. I had to modify these lines:

// listen for form submit, and then  
   document.querySelector('**#gform_2**')
  .addEventListener("submit", function (e) {
    // stop the normal behavior
    e.preventDefault() 

    // get the email value out of the form
    var submittedEmail = document.querySelector('**#gform_2 input[name="input_1"**]').value;

I ask ou if there is a way to make this code generic and not referred to a specific form.
Thank you very much!

1 Like

@jskole @marketingconresultad - Very useful information. Thanks. I may sound very silly, but how do I find the form id. #gform_2 – I’m using thrive leads and thrive lightbox and doing API of Active Campaign. I would appreciate your help. Thanks

@femmevitality you would need to use your chrome dev tools to inspect the element and grab the form id.

Take a look at this screenshot from the codepen

Hey all,

Biannca here from our CX team :wave:

I just wanted to share this with those who come across this post, we have a guide that shares insights on how to pass a contact’s email address into javascript code if you already have the contact’s email address. You will need to add a snippet of code to your Javascript code, see screenshot for snipper of code https://share.zight.com/YEuwl6w1 - for more information see this section of our guide.

Please don’t hesitate to reply back out or email us at help@activecampaign.com if you have any further questions.