How To Exclude Query String Parameters From Destination URL sProp in Adobe Launch
Capturing the current URL that’s loaded in the browser can be used as a traffic variable [sProp] to identify each page view hit.
However, with campaign tagged url’s , this can result in the sProp variable getting populated with separate rows for the same URL. Example:
All of these will have the destination URL sProp showing three different rows for the same homepage.
In order to tackle this, you can correct it via a data element in Adobe Launch.
Head over to Data Elements > Core Extension > Custom Code and paste the below code [that I got from Stack Overflow]
This will return the current document and remove everything from the ‘?’ query string starter.
Before you even apply this data element in your Adobe Analytics ‘Set Variables’ action, you can try it out in your browser’s Console log.
Here’s a test for Twitter homepage without any query parameters.
and here’s the same page with query parameters.
As you can see, the output is Twitter.com minus the query string parameter, campaign=1234.
In Adobe Launch, you do need to add the ‘return’ bit in the Custom JS code to pull the value though.
That’s it, your sProp variable values are now clean. Campaign parameters can be captured as a separate eVar and in the s.Campaign variable that’s available in the Adobe Analytics extension settings.