Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EBI-Framework
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ebiwd
EBI-Framework
Commits
3286d81c
Commit
3286d81c
authored
7 years ago
by
khawkins98
Browse files
Options
Downloads
Patches
Plain Diff
catch when ga is undefined
mitigates
https://github.com/ebiwd/EBI-Framework/pull/96
parent
6eed831a
No related branches found
Branches containing commit
Tags
v1.2-alpha.1
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/foundationExtendEBI.js
+6
-4
6 additions, 4 deletions
js/foundationExtendEBI.js
with
6 additions
and
4 deletions
js/foundationExtendEBI.js
+
6
−
4
View file @
3286d81c
...
...
@@ -15,10 +15,12 @@ var numberOfEbiGaChecks = 0;
var
numberOfEbiGaChecksLimit
=
2
;
var
lastGaEventTime
=
Date
.
now
();
// track the last time an event was send (don't double send)
function
ebiGaCheck
()
{
if
(
ga
&&
ga
.
loaded
)
{
jQuery
(
'
body
'
).
addClass
(
'
google-analytics-loaded
'
);
// Confirm GA is loaded, add a class if found
ebiGaInit
();
}
else
{
try
{
if
(
ga
&&
ga
.
loaded
)
{
jQuery
(
'
body
'
).
addClass
(
'
google-analytics-loaded
'
);
// Confirm GA is loaded, add a class if found
ebiGaInit
();
}
}
catch
(
err
)
{
if
(
numberOfEbiGaChecks
<
numberOfEbiGaChecksLimit
)
{
numberOfEbiGaChecks
++
;
setTimeout
(
ebiGaCheck
,
900
);
// give a second check if GA was slow to load
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment