Skip to content

Commit

Permalink
Switch to use new JavaScript library to avoid requireJS conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
sahava committed Jun 2, 2021
1 parent b3b61c2 commit 48dc400
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions template.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const setMilestones = () => {
};

// Load the library
injectScript('https://unpkg.com/web-vitals', setMilestones, data.gtmOnFailure, 'web-vitals');
injectScript('https://unpkg.com/web-vitals/dist/web-vitals.iife.js', setMilestones, data.gtmOnFailure, 'web-vitals');


___WEB_PERMISSIONS___
Expand Down Expand Up @@ -252,7 +252,7 @@ ___WEB_PERMISSIONS___
"listItem": [
{
"type": 1,
"string": "https://unpkg.com/web-vitals"
"string": "https://unpkg.com/web-vitals/dist/web-vitals.iife.js"
}
]
}
Expand Down Expand Up @@ -294,7 +294,7 @@ scenarios:
\ 1.55, valueRounded: 1, deltaRounded: 2}); },\n getFID: (cb) => { milestoneCount++;\
\ cb({name: 'FID', id: 'FID', value: 1.23, delta: 1.55, valueRounded: 1, deltaRounded:\
\ 2}); }\n };\n});\n \n// Call runCode to run the template's code.\nrunCode({});\n\
\n// Verify that the tag finished successfully.\nassertApi('injectScript').wasCalledWith('https://unpkg.com/web-vitals',\
\n// Verify that the tag finished successfully.\nassertApi('injectScript').wasCalledWith('https://unpkg.com/web-vitals/dist/web-vitals.iife.js',\
\ success, failure, 'web-vitals');\nassertThat(milestoneCount, 'webVitals called\
\ incorrect number of times').isEqualTo(3);\nassertApi('gtmOnSuccess').wasCalled();"
- name: Namespace test
Expand Down Expand Up @@ -326,7 +326,7 @@ scenarios:
\ getFID: (cb) => { milestoneCount++; cb({name: 'FID', id: 'FID', value: 1.23,\
\ delta: 1.55, valueRounded: 1, deltaRounded: 2}); }\n };\n});\n \n// Call runCode\
\ to run the template's code.\nrunCode({namespace: true});\n\n// Verify that the\
\ tag finished successfully.\nassertApi('injectScript').wasCalledWith('https://unpkg.com/web-vitals',\
\ tag finished successfully.\nassertApi('injectScript').wasCalledWith('https://unpkg.com/web-vitals/dist/web-vitals.iife.js',\
\ success, failure, 'web-vitals');\nassertThat(milestoneCount, 'webVitals called\
\ incorrect number of times').isEqualTo(3);\nassertThat(lcpPushed, 'LCP object\
\ not pushed into dataLayer').isEqualTo(true);\nassertThat(fidPushed, 'FID object\
Expand Down

0 comments on commit 48dc400

Please sign in to comment.