Can you capture, store, and retrieve QSP value in Launch?

Avatar

Avatar
Validate 1
Level 1
chischa
Level 1

Likes

0 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
chischa
Level 1

Likes

0 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
chischa
Level 1

01-12-2020

If user clicks on our ad and QSP ?ex_id=123456 is appended to the URL of our landing page, is Launch able to store that QSP? I want to later retrieve that same QSP value from the landing page at the point of purchase, in the same browsing session, and insert that value in a parameter of a marketing tag. 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Affirm 50
MVP
evolytics_brian
MVP

Likes

80 likes

Total Posts

170 posts

Correct reply

54 solutions
Top badges earned
Affirm 50
Applaud 25
Establish
Seeker
Give Back
View profile

Avatar
Affirm 50
MVP
evolytics_brian
MVP

Likes

80 likes

Total Posts

170 posts

Correct reply

54 solutions
Top badges earned
Affirm 50
Applaud 25
Establish
Seeker
Give Back
View profile
evolytics_brian
MVP

02-12-2020

@chischa - Of course.

Just create a new data element and set the "Storage Duration" option to "Session" (or whatever duration you need). When you're ready to add the value to your marketing tag, just reference the data element.

evolytics_brian_0-1606922275735.png

 

Answers (1)

Answers (1)

Avatar

Avatar
Affirm 50
MVP
evolytics_brian
MVP

Likes

80 likes

Total Posts

170 posts

Correct reply

54 solutions
Top badges earned
Affirm 50
Applaud 25
Establish
Seeker
Give Back
View profile

Avatar
Affirm 50
MVP
evolytics_brian
MVP

Likes

80 likes

Total Posts

170 posts

Correct reply

54 solutions
Top badges earned
Affirm 50
Applaud 25
Establish
Seeker
Give Back
View profile
evolytics_brian
MVP

03-12-2020

@chischa - The problem is that the "Session" storage duration for a data element uses sessionStorage, which is hostname- (subdomain) specific. Here's one possible way to deal with it:

https://gist.github.com/hitGovernor/cecf482ffb3e36c514c7ffddf957007d

In short, you'll need to create TWO separate data elements:

  1. The first data element pulls the value from the query parameter. For the sake of conversation, let's name it "qsp:ex_id" and set storage duration to "None"
  2. The second data element uses custom code to reference the the "qsp:ex_id" data element, set a cookie on your root domain (.example.com), and return the query param value. For the sake of this conversation, name it "cookie:ex_id". Use the code from the above GitHub link for this data element.

This example sets the cookie for with session expiration, and should be accessible across subdomains.

Once both are created, make sure reference the "cookie:ex_id" data element on load of every page. If you don't, the code won't execute, and the cookie will not be created. (You don't have to use the information, but you have to execute the logic. In my testing, I just triggered a _satellite.getVar("cookie:ex_id") in a rule that fires on load of every page.)

To populate the parameter on your marketing tag, just use the "cookie:ex_id" data element and you should see the ?ex_id value.

It should go without saying, but this all assumes you're in the same session and that all pages are on the same root domain (.example.com).

Good luck!