Skip to content

Commit

Permalink
Fixing #62 to allow events to be pushed onto dataLayer array before G…
Browse files Browse the repository at this point in the history
…TM initializes
  • Loading branch information
robflaherty committed Jun 8, 2015
1 parent 59d1ad4 commit 03b36d7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion jquery.scrolldepth.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@
if (typeof options.eventHandler === "function") {
standardEventHandler = options.eventHandler;
} else if (typeof dataLayer !== "undefined" && typeof dataLayer.push === "function") {
standardEventHandler = dataLayer.push;

standardEventHandler = function(data) {
dataLayer.push(data);
}

}

if (options.percentage) {
Expand Down

0 comments on commit 03b36d7

Please sign in to comment.