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
Bugfix - Initialize scripts in the correct order #585
Conversation
It is the Google Tag Manger that is causing the error. |
I'm pretty sure this is a hidden error here and on the live site TBH. Take a look at the live www site source, it loads jQuery after Google Tag Manager. GTM has the |
So that would mean we're not capturing stats on any browsing instance where the GTM beats out jQuery right? |
@jimmynotjim , Great point. Needs to be investigated if we think it's occurring on production and thus the stats are bonked. |
Linking this conversation to #496. As far as the scope of this PR, everything good? |
yep, 👍 |
Hi - I'm having issues following this thread. Is there someone I could hop on a call with? Are you all seeing the error on one page in particular? If so, I can test to see the impact on analytics. Chuck should also be included in this conversation. |
@bethannenc Emailing you the staging url so you can give it a test. |
Is it only happening on pages where JQuery is not present? Or is it happening on pages that do have JQuery? @wernerc - you should be roped into this as well. |
The issue is outside the scope of this PR (which will be closed once merged). Let's keep this discussion in #496 so that it's not lost once that happens. |
It looks like it's pretty consistently happening on slower connections or bigger pages. If you open Chrome Developer Tool's network emulator and set it to "Good 3G" or lower you can get the gtm.js errors consistently. |
Are you all only seeing the error on demo or are you seeing it on www.consumerfinance.gov as well? |
- modified page specific scripts with init wrapper to ensure scripts are initialized in the correct order - ensured jQuery is required first to avoid undefined errors
6408f5a
to
9bccfa3
Compare
I can not replicate this on www.consumerfinance.gov. Looking at the page source, jQuery is defined before GTM (L:70 and L:85) respectively. @anselmbradford where did you see jQuery loaded after GTM? As far as this PR, updated the changelog and merging. |
Bugfix - Initialize scripts in the correct order
Fixes an issue where common.js was initializing scripts in the wrong order
Additions
Removals
Changes
Testing
Review
Preview
None
Preview this PR without the whitespace changes
Notes