Skip to content

Instantly share code, notes, and snippets.

@sahava
Created October 21, 2020 19:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sahava/b6a7d5d89908691299b032389b439f41 to your computer and use it in GitHub Desktop.
Save sahava/b6a7d5d89908691299b032389b439f41 to your computer and use it in GitHub Desktop.
(function() {
var oldPush = window.dataLayer.push;
window.dataLayer.push = function() {
var states = [].slice.call(arguments, 0);
// do what you want here
// in response to dataLayer.push()
return oldPush.apply(window.dataLayer, states);
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment