Skip to content

Commit

Permalink
Merge pull request #36 from igor-kamil/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Mar 10, 2021
2 parents 12e6009 + 6dd2f56 commit f4f14c3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,16 +236,18 @@ GoogleTagManager also has a `dump()` function to convert arrays to json objects
```

```js
$('[data-gtm-click]').on('click', function() {
$('[data-gtm-click]').on('click', function(event) {
event.preventDefault();
var self = this;
dataLayer.push({
'event': 'productClick',
'ecommerce': {
'click': {
'products': $(this).data('gtm-product')
'products': $(self).data('gtm-product')
}
}
},
'eventCallback': function() {
document.location = $(this).attr('href');
document.location = $(self).attr('href');
}
});
});
Expand Down

0 comments on commit f4f14c3

Please sign in to comment.