AppMeasurement strips query strings from link tracking URLs by default. Use the linkLeaveQueryString
variable to preserve query strings in link tracking dimensions.
For some exit links and download links, the important portion of the URL can be in the query string. For example, a download link such as https://example.com/download.asp?filename=myfile.exe
contains important link information in the query string.
If link tracking information is not in URLs on your site, using this variable is not necessary. Stripping query strings from link tracking URLs helps limit the number of unique values the dimension contains.
Enabling linkLeaveQueryString
applies to all link tracking dimensions (including custom links, exit links, and download links).
This variable does not affect dimensions outside of link tracking. It only affects custom links, exit links, and download links.
Query strings are not stripped from the XDM field web.webInteraction.URL
. If you want to strip query strings from this XDM field, you can edit it using onBeforeEventSend
.
Keep URL Parameters is a checkbox under the Link Tracking accordion when configuring the Adobe Analytics extension.
Check this box if you want to include query strings in link tracking dimensions.
The s.linkLeaveQueryString
variable is a boolean. Its default value is false
.
true
, query strings are preserved in link tracking URLs.false
or not defined, query strings are stripped from link tracking URLs.s.linkLeaveQueryString = true;
Be careful when setting this variable to true, as it can impact link tracking filters like linkInternalFilters
, linkExternalFilters
, and linkDownloadFiletypes
.
Consider the following example as if it were on adobe.com
:
<script>
s.linkInternalFilters = "adobe.com";
s.linkLeaveQueryString = true;
</script>
<!--This link is not an exit link because the internal filter matches part of the query string -->
<a href = "example.com?r=adobe.com">Example link</a>