Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

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

chischa
Level 1
Level 1

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. 

1 Accepted Solution
evolytics_brian
Correct answer by
Community Advisor
Community Advisor

@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

 

View solution in original post

0 Replies
evolytics_brian
Correct answer by
Community Advisor
Community Advisor

@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

 

View solution in original post

chischa
Level 1
Level 1
Thanks @evolytics_brian. Would it be the same session if the user is redirected to alternative payment type domain, such as paypal, in the same tab?
evolytics_brian
Community Advisor
Community Advisor
It should be. A session won't end just by navigating to a different page. However, if you walk away for an hour or close your browser, you'll lose the information. (You won't be able to read the cookie on a different domain [ie// Paypal], though. The customer will have to come back to your site if you want to read the cookie.)
chischa
Level 1
Level 1
Thanks again @evolytics_brian. I'm managing two different domains. The QSP Data element works for domain1, and your guidance helped me get to the right place. Domain2 adds a subdomain once the user goes into the commerce section of the site. There must be something disrupting the users session when moving over to commerce. Even extending the duration to visitor did not work unfortunately.
evolytics_brian
Community Advisor
Community Advisor

@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!