Skip to content

Commit

Permalink
fixes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
keshikashviligio committed May 24, 2018
1 parent 18668df commit 93b714c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ApGaOptOut.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@
return;
}
var self = this,
el = document.querySelector(self.elementSelector);
if (el) {
el.addEventListener(self.optOutCallEvent, function () {
self._log(self.optOutCallEvent + ' Triggered');
self._setGaOptOut();
})
elements = document.querySelectorAll(self.elementSelector);
if (elements.length) {
for (var i = 0; i < elements.length; i++) {
elements[i].addEventListener(self.optOutCallEvent, function () {
self._log(self.optOutCallEvent + ' Triggered');
self._setGaOptOut();
})
}
}

this._checkGaOptOut();
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
</head>
<body>
<a href="#jsgaoptout" class="jsgaoptout">Click here to disable google analytics</a>
<a href="#jsgaoptout" class="jsgaoptout">Click here to disable google analytics</a>
</body>
</html>

0 comments on commit 93b714c

Please sign in to comment.