Analytics | Bug | Fix Autotrack and Autolink JS Errors When GA Config / GA Script Missing #1321
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Jira
http://vjira2:8080/browse/BDS-1724
Summary
Updates the Javascript to the
@bolt/analytics-autolink
and@bolt/analytics-autotrack
packages to no longer throw a Javascript error if GA's Javascript never loads OR if a config for tracking external-bound links is undefined.How To Test
npm run setup
, and start up the local dev environment vianpm start
How to test the Autotrack JS fix
docs-site/src/templates/_site-head.twig
file and comment out thewindow.drupalSettings
config in the<head>
@bolt/analytics-autotrack
package about a non-existentwindow.drupalSettings.google_analytics.trackCrossDomains
config option no longer occurs.How to test the Autolink JS fix
docs-site/src/templates/_site-head.twig
file and comment out the google analytics script tag in the<head>
@bolt/analytics-autolink
JS package about the missingga.getAll
method no longer occurs.