Permalink
Browse files

Add window location to Google Analytics closes #3

  • Loading branch information...
ivanstegic committed Nov 30, 2016
1 parent 8f01597 commit 0f364c4b5a35bb78553ae210ae2a0df8cd6a38c1
Showing with 7 additions and 4 deletions.
  1. +7 −4 jquery.interceptjs.js
View
@@ -104,7 +104,7 @@
// Wait for show_delay seconds before actually showing anything
var tid = window.setTimeout(function() {
if (use_ga) {
ga('send', 'event', 'interceptjs', 'show_intercept', settings.type);
ga('send', 'event', 'interceptjs', 'show_intercept_' + settings.type, window.location.href);
}
switch (settings.type) {
// Popup
@@ -127,7 +127,7 @@
// Click events: banner
$('.ijs_close').on('click', function() {
if (use_ga) {
ga('send', 'event', 'interceptjs', 'close_intercept', settings.type);
ga('send', 'event', 'interceptjs', 'close_intercept_' + settings.type, window.location.href);
}
$('.ijs_intercept').hide();
ijs.user_dismiss = 1;
@@ -136,14 +136,17 @@
});
$('.ijs_click').on('click', function() {
if (use_ga) {
ga('send', 'event', 'interceptjs', 'click_intercept', settings.type);
ga('send', 'event', 'interceptjs', 'click_intercept_' + settings.type, window.location.href);
}
$('.ijs_intercept').hide();
ijs.user_dismiss = 1;
Cookies.set('ijs', ijs);
return;
});
// Click events: modal
$('#ijs_modal').on($.modal.CLOSE, function(event, modal) {
if (use_ga) {
ga('send', 'event', 'interceptjs', 'close_intercept', settings.type);
ga('send', 'event', 'interceptjs', 'close_intercept_' + settings.type, window.location.href);
}
ijs.user_dismiss = 1;
Cookies.set('ijs', ijs);

0 comments on commit 0f364c4

Please sign in to comment.