Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- if (window.Element && !Element.prototype.closest) {
- Element.prototype.closest =
- function(s) {
- var matches = (this.document || this.ownerDocument).querySelectorAll(s),
- i,
- el = this;
- do {
- i = matches.length;
- while (--i >= 0 && matches.item(i) !== el) {};
- } while ((i < 0) && (el = el.parentElement));
- return el;
- };
- }
- (function () {
- document.querySelector('body').addEventListener('click', function(event) {
- var offerCard = event.target.closest('[data-component="offer-card"]');
- var isUserSawAdoricCampaign = window.localStorage.getItem('adoricCouponesRedirect');
- if (offerCard && isUserSawAdoricCampaign) {
- window.localStorage.removeItem('adoricCouponesRedirect');
- window.ga && window.ga('t0.send', 'event', {
- eventCategory: 'Adoric - user add coupon',
- eventAction: 'click',
- eventLabel: 'User added coupon by Adoric campaign'
- });
- }
- });
- })();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment