Expand my Community achievements bar.

SOLVED

User browsing history in Target in previous sessions

Avatar

Level 10

We only have Target at our disposal.

I would like to combine two audiences:

1. Current session - easy

Comes from Google + landing page contains "real-estate" 

2. Past session - not sure if feasible without AEP, AAM or AA 

Session from > 7days , comes from Linkedin (utm) and landing page parameter also contains "real-estate" 

 

Is Target able to keep events from past sessions? Going through documentation most parameters are about current behaviour

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 2

@Michael_Soprano

Good question!

Target can easily handle the first case — someone coming from Google and landing on a page with "real-estate" in the URL. That’s based on the current session, which Target works well with.

For the second case — someone who visited from LinkedIn more than 7 days ago — it’s a bit trickier. Target doesn’t store past session data by default.

But there are a couple of ways to work around this:

  1. Use a profile attribute or script
    When someone visits your site with a specific utm_source (like LinkedIn), you can save that value to their Target profile. That way, you can target them later based on that info — as long as their profile is still active.
  2. Use a cookie
    You can store the utm_source value in a cookie, and then pass it to Target as a parameter. Then, create an audience based on that cookie value.

Both options require capturing the data when the user first visits — Target can’t go back and get it after the fact.

Let me know if you'd like help setting this up!

View solution in original post

3 Replies

Avatar

Correct answer by
Level 2

@Michael_Soprano

Good question!

Target can easily handle the first case — someone coming from Google and landing on a page with "real-estate" in the URL. That’s based on the current session, which Target works well with.

For the second case — someone who visited from LinkedIn more than 7 days ago — it’s a bit trickier. Target doesn’t store past session data by default.

But there are a couple of ways to work around this:

  1. Use a profile attribute or script
    When someone visits your site with a specific utm_source (like LinkedIn), you can save that value to their Target profile. That way, you can target them later based on that info — as long as their profile is still active.
  2. Use a cookie
    You can store the utm_source value in a cookie, and then pass it to Target as a parameter. Then, create an audience based on that cookie value.

Both options require capturing the data when the user first visits — Target can’t go back and get it after the fact.

Let me know if you'd like help setting this up!

Avatar

Level 3

Is there a reference on how to create profile scripts like you described?

Avatar

Level 2

@maccg12 Here is a simple profile script that captures the utm_source parameter along with a timestamp on a new session page visit. The script stores all utm_source values, adding the most recent one at the beginning of the string.

Please note: Profile attributes can store a maximum of 256 characters. If the total value exceeds this limit, the excess characters will be trimmed.

 

var utm_source = page.param('utm_source');
if(utm_source && user.isNewSession){
  var prevVal = user.get('utm_source');
  var timeStamp = new Date();
  return utm_source + '|' + timeStamp + (prevVal ? '||' + prevVal : '');
}

 

Let me know if you have any questions or need further adjustments!