ActiveCampaign Forum

Identify User from Newsletter Click


#1

Hi!

We have to following use case:

  1. User fills out the newsletter register form on a page
  2. User is now identified on the page by cookie and we can retrieve the contact object through the API
  3. Some days later, the same User becomes a newsletter and open the site link from another computer as step 1 was done. Active Campaign sets an new cookie on the page, based on the tracking link in the mail.

Isn’t it possible to retrieve the contact data through the API (methods contact_view, contact_view_mail or contact_view_hash) based on this cookie from the tracking link?

Otherwise we have to pass a contact parameter (for example the mail address) on every link in the newsletter to later identify the user based on this parameter.

I hope its understandable what I want to achieve.
Thanks a lot!


#2

Hi @snapsnap,

I am a bit confused what you are hoping to achieve. Did you want to personalize the site based on user attributes?

I see a few issues with your strategy, mostly around step 2 in your plan.

Isn’t it possible to retrieve the contact data through the API (methods contact_view, contact_view_mail or contact_view_hash) based on this cookie from the tracking link?

A: Not really. If you have the contact’s email, contact’s id, or both, you can make a request to the API to pull the complete contact record. However

It is not trivial to be able to pull a user from the API using only the AC site tracking cookie. I am not even sure it is possible.

If you only want to make sure the contact is identified via ActiveCampaign Site Tracking, which is a common use case, then all you need to do is install Site Tracking snippet on our site. If you are using our forms, the contact will be identified automatically.

If you are using custom or 3rd party forms, you will need to identify the user manually, but setting the trackcmp_email variable to the user’s email address before calling site tracking (or setting the variable and calling site tracking again).

But we will also re-identify the user every time they click on a link from an email. In your example on step 3, you dont need to do anything the contact will be updated on their own.

Does that help to answer your question?


#3

Hi @jskole

Our goal is to show the firstname of the contact on the website.
As you described, when the user fill out the AC form, the user will be identified and AC stores a cookie. At the same time, we store the e-mail address in the cookie on our self to later retrieve the first name over the AC API by email. This works fine.

But when the user opens the website in another browser (for example after he clicks on the site link to our site in a AC Newsletter), there isn’t a cookie which we can identify the user by mail, id or something else.
In this case, it would be useful if AC sets a cookie on the site after the user clicked on the site link in the mail. With this cookie, we can identify the user again and we can personalize the user through the complete user journey.


#4

@snapsnap

Ahhh I see, okay so there are a few ways!

  • Use a query param like how you described. I would probably do it this way personally, and then have a script run on page load that checks if that query param exists and stores a value in localStorage.
  • Deconstruct the cookie. When a user clicks on a link from an email, we do identify them and store the value in a cookie. So for example, if a user submits a form from device “a” then they will be identified. If we later send an email and the user checks on device “b” and clicks an email in the link, the user will be identified and all following Site Tracking activity on device “b” will be logged to the contact profile.

Like I said, I personally haven’t deconstructed the cookie like that to try and fetch the entire contact record, I would be more likely to just do the first option.


#5

@jskole

Thanks for your response!

We already tried to deconstruct the cookie, but it’s not possible because the the hash which is set by click on the mail link is not the same as we can retrieve the user by the contact_view_hash API method.

So I think the only way is to use a query parameter. It would be great if there would be an option to append this parameter automatically to every link, so we don’t have to add it on every page link in the newsletter.


#6

Agreed! I talked to the product team about this and submitted an internal idea. I would encourage you to submit your feedback too! https://ideas.activecampaign.com/


#7

Hi @snapsnap. What is the name of the cookie that you tried to deconstruct? (I want to try this myself also.)

Thanks.


#8

Any news on this feature? Because we also would like to identify users if they are known by site tracking. A javascript query to trackcmp.net/whoami with a contact hash result will be fine. Hope we can work this out…


#9

@coen Do you know more about this now? Would someone from AC give a status here, please?