WP Google Analytics Events - Version 2.5.3

Version Description

Download this release

Release Info

Developer yuvalo
Plugin Icon 128x128 WP Google Analytics Events
Version 2.5.3
Comparing to
See all releases

Code changes from version 2.5.2 to 2.5.3

Files changed (3) hide show
  1. ga-scroll-event.php +4 -5
  2. js/ga-scroll-events.js +6 -2
  3. readme.txt +5 -2
ga-scroll-event.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Google Analytics Events
4
  Plugin URI: http://wpflow.com
5
  Description: Adds the Google Analytics code to your website and enables you to send events on scroll or click.
6
- Version: 2.5.2
7
  Author: Yuval Oren
8
  Author URI: http://wpflow.com
9
  License: GPLv2
@@ -84,7 +84,7 @@ add_action('init','ga_events_scripts');
84
 
85
  function ga_events_scripts() {
86
  wp_enqueue_script('jquery');
87
- wp_enqueue_script('scrolldepth',plugins_url( '/js/ga-scroll-events.js', __FILE__) , array('jquery'), '2.5.2', false);
88
  }
89
 
90
  add_action( 'plugins_loaded', 'ga_events_setup');
@@ -115,15 +115,14 @@ function ga_events_header() {
115
  ?> <script type='text/javascript'>
116
  if (typeof _gaq === 'undefined') {
117
  var _gaq = _gaq || [];
118
- _gaq.push(['_setAccount', '$id']);
119
  <?php if (isset($options['anonymizeip']) && $options['anonymizeip']) echo "_gaq.push (['_gat._anonymizeIp'])"; ?>
120
- _gaq.push(['_setDomainName', '$domain']);
121
  _gaq.push(['_setAllowLinker', true]);
122
  _gaq.push(['_trackPageview']);
123
 
124
  (function() {
125
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
126
- ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
127
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
128
  })();
129
  }
3
  Plugin Name: WP Google Analytics Events
4
  Plugin URI: http://wpflow.com
5
  Description: Adds the Google Analytics code to your website and enables you to send events on scroll or click.
6
+ Version: 2.5.3
7
  Author: Yuval Oren
8
  Author URI: http://wpflow.com
9
  License: GPLv2
84
 
85
  function ga_events_scripts() {
86
  wp_enqueue_script('jquery');
87
+ wp_enqueue_script('scrolldepth',plugins_url( '/js/ga-scroll-events.js', __FILE__) , array('jquery'), '2.5.3', false);
88
  }
89
 
90
  add_action( 'plugins_loaded', 'ga_events_setup');
115
  ?> <script type='text/javascript'>
116
  if (typeof _gaq === 'undefined') {
117
  var _gaq = _gaq || [];
118
+ <?php echo "_gaq.push(['_setAccount', '$id']);"; ?>
119
  <?php if (isset($options['anonymizeip']) && $options['anonymizeip']) echo "_gaq.push (['_gat._anonymizeIp'])"; ?>
 
120
  _gaq.push(['_setAllowLinker', true]);
121
  _gaq.push(['_trackPageview']);
122
 
123
  (function() {
124
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
125
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
126
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
127
  })();
128
  }
js/ga-scroll-events.js CHANGED
@@ -1,5 +1,5 @@
1
  /*!
2
- * WP Googel Analytics Events | v2.5.2
3
  * Copyright (c) 2013 Yuval Oren (@yuvalo)
4
  * License: GPLv2
5
  */
@@ -67,7 +67,11 @@ var scroll_events = (function ($) {
67
  }
68
  else {
69
  // ga_element.push(['_trackEvent',category, action, label]);
70
- ga_element.push( ['_trackEvent',category, action, label, event_value, event_bounce] );
 
 
 
 
71
  }
72
 
73
  };
1
  /*!
2
+ * WP Googel Analytics Events | v2.5.3
3
  * Copyright (c) 2013 Yuval Oren (@yuvalo)
4
  * License: GPLv2
5
  */
67
  }
68
  else {
69
  // ga_element.push(['_trackEvent',category, action, label]);
70
+ if (event_value) {
71
+ ga_element.push( ['_trackEvent',category, action, label, event_value, event_bounce] );
72
+ } else {
73
+ ga_element.push( ['_trackEvent',category, action, label,, event_bounce] );
74
+ }
75
  }
76
 
77
  };
readme.txt CHANGED
@@ -1,8 +1,8 @@
1
  === WP Google Analytics Events ===
2
  Contributors: yuvalo
3
  Tags: analytics, google, events, ga, google analytics, tracking
4
- Tested up to: 4.9.8
5
- Stable tag: 2.5.2
6
  License: GPLv2
7
  Requires at least: 3.0
8
 
@@ -91,6 +91,9 @@ If you are looking for more in-depth support, we encourage you to check out [WP
91
  2. Google Analytics real time events screenshot-2.png
92
  == Changelog ==
93
 
 
 
 
94
  = Version 2.5.2 =
95
  1. Fixed a javascript error when ad blockers are on
96
 
1
  === WP Google Analytics Events ===
2
  Contributors: yuvalo
3
  Tags: analytics, google, events, ga, google analytics, tracking
4
+ Tested up to: 5.0.3
5
+ Stable tag: 2.5.3
6
  License: GPLv2
7
  Requires at least: 3.0
8
 
91
  2. Google Analytics real time events screenshot-2.png
92
  == Changelog ==
93
 
94
+ = Version 2.5.3 =
95
+ 1. Fixed a regression bug when working with legacy Google Analytics code snippets
96
+
97
  = Version 2.5.2 =
98
  1. Fixed a javascript error when ad blockers are on
99