Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated query-string module to fix parsing error #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

736F75726365
Copy link

Loading a web page with 2 or more instances of the "%" character in the URL query string breaks multiple aspects of Launch functionality including the Adobe Analytics module (never fires main page view tracking call) as well as causing any query string parameter data elements to continuously output errors in the browser console (when Launch debug output to the console is enabled).

Example URL:
https://www.adobe.com/?utm_campaign=abc%%123%20%%hello%%%%&utm_source=search

Loading the URL above will result in the Adobe Analytics tracking call not firing on adobe.com and numerous errors will appear in the browser console (continuously) for all Launch data elements using the Core module's query string parameter data element functionality. Make sure to enable Launch debug mode to see those errors.

Pull Request Description

I added a simple regex string replace in reactorQueryString object to remove any occurrences of 2 or more "%" characters from the query string before the value is passed to the "query-string" module "decode" function which reactorQueryString proxies as the "parse" function.

Motivation and Context

Adobe Analytics should ALWAYS be able to fire the main pageview tracking call, otherwise finding issues and errors related to malformed URL's like this is -extremely- difficult since they will not appear in reporting anywhere to alert business stakeholders of a potential problem.

How Has This Been Tested?

Yes, it has been tested - the easiest way to see the issue and to test the fix is by including the "SDI Toolkit" Launch Extension on any website with Launch active because that particular extension exposes the reactor.queryString module outside of the reactor-turbine closure for normal usage from the global window context.

Run the JS snippets below in the browser developer console to see the before/after behavior using the same regex string replacement that this pull request includes.

ERROR:
var badQueryString = "utm_campaign=abc%%123%20%%hello%%%%&utm_source=search";
_sdiToolkit.reactor.queryString.parse(badQueryString);

NO ERROR:
var badQueryString = "utm_campaign=abc%%123%20%%hello%%%%&utm_source=search";
_sdiToolkit.reactor.queryString.parse(badQueryString.replace(/%%+/gi, ''));

Loading a page with 1 or more instances of "%%" in the URL query string breaks multiple parts of Launch functionality including the Adobe Analytics module and any query string parameter data elements continuously generate errors (when debug output in the console is enabled).
@j0nv
Copy link

j0nv commented Nov 10, 2021

@736F75726365 thanks for flagging this. We're looking into it.

@736F75726365
Copy link
Author

736F75726365 commented Nov 11, 2021

@j0nv - no problem, happy to help. On a related note, I just signed the Adobe CLA a few minutes ago. Do I need to close and re-submit the pull request or is my mentioning that I signed it here in this comment fine?

Additional details discovered since I submitted the pull request:

This error is actually in the native decodeURIComponent JS function built into just about every major browser available today. I checked all of the latest versions of the each listed below and all of them are similarly impacted.

Impacted browsers:

  • Google Chrome (94/95) - Desktop & Mobile
  • Microsoft Edge (95/96) - Desktop & Mobile
  • Firefox (94/95) - Desktop & Mobile
  • Safari (14/15) - Desktop and Mobile
  • Opera (80/81)
  • Yandex 14
  • Internet Explorer 11/10

Example URLs

  • For each, either the entire website breaks, the page fails to load at all, or at minimum have browser console errors
  • Of particular concern is that it appears any site using CloudFlare (like Github) fails to load the page entirely

https://github.com/adobe/?utm_campaign=test%%abc123&utm_source=google_%%%search
https://www.cloudflare.com/?utm_campaign=test%%abc123&utm_source=google_%%%search
https://aws.amazon.com/?utm_campaign=test%%abc123&utm_source=google_%%%search
https://www.gmail.com/?utm_campaign=test%%abc123&utm_source=google_%%%search
https://www.apple.com/shop/buy-mac?utm_campaign=test%%abc123&utm_source=google_%%%search
https://www.google.com/?utm_campaign=test%%abc123&utm_source=google_%%%search
https://discord.com/?utm_campaign=test%%abc123&utm_source=google_%%%search
https://www.xfinity.com/overview?utm_campaign=test%%abc123&utm_source=google_%%%search
https://www.tesla.com/?utm_campaign=test%%abc123&utm_source=google_%%%search
https://www.chevrolet.com/?utm_campaign=test%%abc123&utm_source=google_%%%search
https://www.toyota.com/?utm_campaign=test%%abc123&utm_source=google_%%%search
https://www.dropbox.com/?utm_campaign=test%%abc123&utm_source=google_%%%search

Recommendation

I still recommend integrating this pull request into the reactor-turbine codebase to at least stop the bleeding when it comes to Adobe Analytics not firing when deployed via Launch.

However, since the error originates in the native decodeURIComponent JS function included in just about every major browser available, I highly recommend adding a custom version of that function (obviously with the error in it fixed) or a proxy version of it that includes the regex replace this pull request includes into the reactor-turbine codebase as well and then replacing all references to the native browser function with the integrated custom version instead.

It's going to take weeks if not months for all browsers to deploy a fix for this issue, minimum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Incoming
Development

Successfully merging this pull request may close these issues.

2 participants