digital-analytics-program / gov-wide-code

Provides a set of javascript files and documentation to implement web analytics on US federal websites
http://www.digital.gov/dap
104 stars 55 forks source link

Fix typo causing overwrite of global a, o, t #86

Closed PatKUrbanEmu closed 1 year ago

PatKUrbanEmu commented 1 year ago

It was observed that including this script on a website was causing global variables a, o, and t to get overwritten. Since many sites use minification for scripts, it is possible they will have these variables in their JavaScript, especially a.

A recently added _scrubbedURL() function causes these variable names to be hoisted globally because they lack the var statement. Upon closer observation of the coding style in this script, it appears the line prior was intended to end with a comma (,) but instead ends with a semicolon (;).

Making it a comma in this PR resolves the issue.

smarina04 commented 1 year ago

Thank you for reporting, this is fixed.