Google Universal Analytics - Version 2.4.2

Version Description

  • Small updates.
Download this release

Release Info

Developer audriusd
Plugin Icon wp plugin Google Universal Analytics
Version 2.4.2
Comparing to
See all releases

Code changes from version 2.4.1 to 2.4.2

classic/classic-analytics.php CHANGED
@@ -57,6 +57,6 @@
57
  </form>
58
  </div>
59
  <div class="clearfix"></div>
60
- <div class="row col-lg-6"><?php echo __('Have a question? Drop it at', 'gua'); ?> <a href="http://onlineads.lt/?utm_source=WordPress&utm_medium=Google%20Universal%20Analytics%202.4.1&utm_content=Google%20Classic%20Analytics&utm_campaign=WordPress%20plugins" title="Google Universal Analytics">OnlineAds.lt</a> </div>
61
 
62
 
63
  </br></br>
64
  <strong>Pro Tip:</strong> For periodic Google Analytics data reporting use <a href="https://nexusad.com/?utm_source=wordpress&utm_medium=Google%2BUniversal%2BAnalytics%2B2.4.1&utm_campaign=wp_plugins" title="nexusAd" target="_blank">nexusAd tool</a>.
65
 
66
 
 
67
 
68
 
69
  </br></br>
70
  <strong>Pro Tip:</strong> For periodic Google Analytics data reporting use <a href="https://nexusad.com/?utm_source=wordpress&utm_medium=Google%2BUniversal%2BAnalytics%2B2.4.2&utm_campaign=wp_plugins" title="nexusAd" target="_blank">nexusAd tool</a>.
71
 
72
 
73
  </div>
74
  </br>
57
  </form>
58
  </div>
59
  <div class="clearfix"></div>
 
60
 
61
 
62
  </br></br>
63
  <strong>Pro Tip:</strong> For periodic Google Analytics data reporting use <a href="https://nexusad.com/?utm_source=wordpress&utm_medium=Google%2BUniversal%2BAnalytics%2B2.4.1&utm_campaign=wp_plugins" title="nexusAd" target="_blank">nexusAd tool</a>.
64
 
65
 
66
+ <div class="row col-lg-6"><?php echo __('Have a question? Drop it at', 'gua'); ?> <a href="http://onlineads.lt/?utm_source=WordPress&utm_medium=Google%20Universal%20Analytics%202.4.2&utm_content=Google%20Classic%20Analytics&utm_campaign=WordPress%20plugins" title="Google Universal Analytics">OnlineAds.lt</a> </div>
67
 
68
 
69
  </br></br>
70
  <strong>Pro Tip:</strong> For periodic Google Analytics data reporting use <a href="https://nexusad.com/?utm_source=wordpress&utm_medium=Google%2BUniversal%2BAnalytics%2B2.4.2&utm_campaign=wp_plugins" title="nexusAd" target="_blank">nexusAd tool</a>.
71
 
72
 
73
  </div>
74
  </br>
classic/custom-analytics.php CHANGED
@@ -56,6 +56,5 @@
56
  </form>
57
  </div>
58
  <div class="clearfix"></div>
59
- <div class="row col-lg-6"><?php echo __('Have a question? Drop it at', 'gua'); ?> <a href="http://onlineads.lt/?utm_source=WordPress&utm_medium=Google%20Universal%20Analytics%202.4.1&utm_content=Google%20Custom%20Analytics&utm_campaign=WordPress%20plugins">OnlineAds.lt</a> </div>
60
 
61
  </br></br>
62
  <strong>Pro Tip:</strong> For periodic Google Analytics data reporting use <a href="https://nexusad.com/?utm_source=wordpress&utm_medium=Google%2BUniversal%2BAnalytics%2B2.4.1&utm_campaign=wp_plugins" title="nexusAd" target="_blank">nexusAd tool</a>.
63
 
64
- </div>
65
- </br>
66
 
67
  </br></br>
68
  <strong>Pro Tip:</strong> For periodic Google Analytics data reporting use <a href="https://nexusad.com/?utm_source=wordpress&utm_medium=Google%2BUniversal%2BAnalytics%2B2.4.2&utm_campaign=wp_plugins" title="nexusAd" target="_blank">nexusAd tool</a>.
69
 
 
56
  </form>
57
  </div>
58
  <div class="clearfix"></div>
 
59
 
60
  </br></br>
61
  <strong>Pro Tip:</strong> For periodic Google Analytics data reporting use <a href="https://nexusad.com/?utm_source=wordpress&utm_medium=Google%2BUniversal%2BAnalytics%2B2.4.1&utm_campaign=wp_plugins" title="nexusAd" target="_blank">nexusAd tool</a>.
62
 
63
+ <div class="row col-lg-6"><?php echo __('Have a question? Drop it at', 'gua'); ?> <a href="http://onlineads.lt/?utm_source=WordPress&utm_medium=Google%20Universal%20Analytics%202.4.2&utm_content=Google%20Custom%20Analytics&utm_campaign=WordPress%20plugins">OnlineAds.lt</a> </div>
 
64
 
65
  </br></br>
66
  <strong>Pro Tip:</strong> For periodic Google Analytics data reporting use <a href="https://nexusad.com/?utm_source=wordpress&utm_medium=Google%2BUniversal%2BAnalytics%2B2.4.2&utm_campaign=wp_plugins" title="nexusAd" target="_blank">nexusAd tool</a>.
67
 
68
+ </div>
googleanalytics.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Google Universal Analytics
4
  Plugin URI: http://wordpress.org/extend/plugins/google-universal-analytics/
5
  Description: Adds <a href="http://www.google.com/analytics/">Google Analytics</a> tracking code on all pages.
6
- Version: 2.4.1
7
  Author: Audrius Dobilinskas
8
  Author URI: http://onlineads.lt/
9
  */
3
  Plugin Name: Google Universal Analytics
4
  Plugin URI: http://wordpress.org/extend/plugins/google-universal-analytics/
5
  Description: Adds <a href="http://www.google.com/analytics/">Google Analytics</a> tracking code on all pages.
6
+ Version: 2.4.2
7
  Author: Audrius Dobilinskas
8
  Author URI: http://onlineads.lt/
9
  */
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: audriusd
3
  Donate link: http://onlineads.lt/
4
  Tags: javascript, tracking, google, analytics, universal, statistics, google analytics, universal analytics, user id, google universal analytics, classic, custom, nexusad
5
  Requires at least: 3.0
6
- Tested up to: 4.0
7
- Stable tag: 2.4.1
8
  License: GPLv2 or later
9
 
10
  Adds the latest Google Universal Analytics JavaScript tracking code to your WordPress website. Many options!
@@ -74,6 +74,9 @@ Check it out [nexusAd tool](https://nexusad.com).
74
 
75
  == Changelog ==
76
 
 
 
 
77
  = 2.4.1 =
78
  * Bug fixes.
79
 
@@ -142,6 +145,10 @@ Check it out [nexusAd tool](https://nexusad.com).
142
 
143
  == Upgrade Notice ==
144
 
 
 
 
 
145
  = 2.4.1 =
146
  * Bug fixes.
147
 
3
  Donate link: http://onlineads.lt/
4
  Tags: javascript, tracking, google, analytics, universal, statistics, google analytics, universal analytics, user id, google universal analytics, classic, custom, nexusad
5
  Requires at least: 3.0
6
+ Tested up to: 4.1
7
+ Stable tag: 2.4.2
8
  License: GPLv2 or later
9
 
10
  Adds the latest Google Universal Analytics JavaScript tracking code to your WordPress website. Many options!
74
 
75
  == Changelog ==
76
 
77
+ = 2.4.2 =
78
+ * Small updates.
79
+
80
  = 2.4.1 =
81
  * Bug fixes.
82
 
145
 
146
  == Upgrade Notice ==
147
 
148
+ = 2.4.2 =
149
+ * Small updates.
150
+ * WordPress 4.0.1 compatability.
151
+
152
  = 2.4.1 =
153
  * Bug fixes.
154
 
tracking-code.php CHANGED
@@ -1,30 +1,49 @@
1
- <?php
 
2
  $web_property_id = get_option( 'web_property_id' );
3
  $track_links = get_option('track_links');
4
  $enable_display = get_option('enable_display');
5
  $anonymize_ip = get_option('anonymize_ip');
6
- $enhancedlink_u = get_option('enhancedlink_u');
7
- if(get_option('set_domain')=='on'){
 
8
  $homeurl = get_option('set_domain_domain');
9
- }
 
 
 
10
  $find = array( 'http://', 'https://', 'www.' );
11
  $replace = '';
12
- $homeurl = str_replace( $find, $replace, $homeurl );
13
  get_currentuserinfo();
14
- ?>
15
- <!-- Google Universal Analytics for WordPress v2.4 -->
16
- <script>
 
 
 
 
 
 
 
17
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
18
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
19
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
20
- })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
21
- ga('create', '<?php echo $web_property_id; ?>', 'auto');<?php echo "\n\r" ?>
 
 
22
  <?php if($anonymize_ip=='on'): ?> ga('set', 'anonymizeIp', true);<?php endif; ?><?php echo "\n\r" ?>
23
  <?php if($enhancedlink_u=='on'): ?> ga('require', 'linkid', 'linkid.js');<?php endif; ?><?php echo "\n\r" ?>
24
  <?php if($enable_display=='on'): ?> ga('require', 'displayfeatures');<?php endif; ?><?php echo "\n\r" ?>
25
- ga('set', 'forceSSL', true);<?php echo "\n\r" ?>
26
- </script>
27
- <?php if($track_links=='on'): ?>
28
- <script type="text/javascript">
 
 
 
 
 
 
29
  jQuery(document).ready(function(e) {
30
  jQuery('a').click(function(e) {
31
  var $this = jQuery(this);
@@ -35,11 +54,16 @@ $homeurl = str_replace( $find, $replace, $homeurl );
35
  }
36
  if (href.toLowerCase().indexOf('mailto:') === 0) {
37
  ga('send', 'event', 'Mailto', href.substr(7));
38
- }
39
  ga('send', 'event', 'Phone number', href.substr(4));
40
  }
 
 
 
 
41
  if ((this.protocol === 'http:' || this.protocol === 'https:') && this.hostname.indexOf(document.location.hostname) === -1) {
42
  ga('send', 'event', 'Outbound', this.hostname, this.pathname);
43
  }
44
  });
45
- });
46
- </script>
 
 
47
  <?php endif;
1
+ <?php
2
+
3
  $web_property_id = get_option( 'web_property_id' );
4
  $track_links = get_option('track_links');
5
  $enable_display = get_option('enable_display');
6
  $anonymize_ip = get_option('anonymize_ip');
7
+ $enhancedlink_u = get_option('enhancedlink_u');
8
+
9
+ /*if(get_option('set_domain')=='on'){
10
  $homeurl = get_option('set_domain_domain');
11
+ }*/
12
+
13
+ $homeurl = @get_option('set_domain_domain');
14
+
15
  $find = array( 'http://', 'https://', 'www.' );
16
  $replace = '';
 
17
  get_currentuserinfo();
18
+ $homeurl = @str_replace( $find, $replace, $homeurl );
19
+
20
+ global $current_user;
21
+ get_currentuserinfo();
22
+ ?>
23
+
24
+ <!-- Google Universal Analytics for WordPress v2.4.2 -->
25
+
26
+ <script>
27
+
28
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
29
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
30
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
31
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
32
+
33
+ ga('create', '<?php echo $web_property_id; ?>', 'auto');<?php echo "\n\r" ?>
34
+ <?php if ( is_user_logged_in() ): ?> ga('set', '&uid', '<?php echo $current_user->ID; ?>');<?php endif; ?><?php echo "\n\r" ?>
35
  <?php if($anonymize_ip=='on'): ?> ga('set', 'anonymizeIp', true);<?php endif; ?><?php echo "\n\r" ?>
36
  <?php if($enhancedlink_u=='on'): ?> ga('require', 'linkid', 'linkid.js');<?php endif; ?><?php echo "\n\r" ?>
37
  <?php if($enable_display=='on'): ?> ga('require', 'displayfeatures');<?php endif; ?><?php echo "\n\r" ?>
38
+ ga('set', 'forceSSL', true);<?php echo "\n\r" ?>
39
+ ga('send', 'pageview');
40
+
41
+ </script>
42
+ <!-- Google Universal Analytics for WordPress v2.4.2 - https://wordpress.org/plugins/google-universal-analytics -->
43
+
44
+ <?php if($track_links=='on'): ?>
45
+
46
+ <script type="text/javascript">
47
+
48
  jQuery(document).ready(function(e) {
49
  jQuery('a').click(function(e) {
50
  var $this = jQuery(this);
54
  }
55
  if (href.toLowerCase().indexOf('mailto:') === 0) {
56
  ga('send', 'event', 'Mailto', href.substr(7));
 
57
  ga('send', 'event', 'Phone number', href.substr(4));
58
  }
59
+ }
60
+ if (href.toLowerCase().indexOf('tel:') === 0) {
61
+ ga('send', 'event', 'Phone number', href.substr(4));
62
+ }
63
  if ((this.protocol === 'http:' || this.protocol === 'https:') && this.hostname.indexOf(document.location.hostname) === -1) {
64
  ga('send', 'event', 'Outbound', this.hostname, this.pathname);
65
  }
66
  });
67
+ });
68
+
69
+ </script>
70
+
71
  <?php endif;