Google Universal Analytics - Version 1.2

Version Description

  • Important: After updating enter full tracking code (not just Web Property ID).
Download this release

Release Info

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

Code changes from version 1.1 to 1.2

Files changed (3) hide show
  1. googleanalytics.php +5 -12
  2. options.php +55 -10
  3. readme.txt +12 -6
googleanalytics.php CHANGED
@@ -2,8 +2,8 @@
2
  /*
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 Universal Analytics</a> tracking code on all pages.
6
- Version: 1.1
7
  Author: Audrius Dobilinskas
8
  Author URI: http://onlineads.lt/
9
  */
@@ -18,7 +18,7 @@ if (!defined('WP_PLUGIN_DIR'))
18
  define('WP_PLUGIN_DIR', WP_CONTENT_DIR.'/plugins');
19
 
20
  function activate_google_universal_analytics() {
21
- add_option('web_property_id', 'UA-23710779-8');
22
  }
23
 
24
  function deactive_google_universal_analytics() {
@@ -41,16 +41,9 @@ function google_universal_analytics() {
41
  $web_property_id = get_option('web_property_id');
42
  ?>
43
 
44
- <script>
45
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
46
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
47
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
48
- })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
49
 
50
- ga('create', '<?php echo $web_property_id ?>', '<?php bloginfo('url'); ?>');
51
- ga('send', 'pageview');
52
-
53
- </script>
54
  <?php
55
  }
56
 
2
  /*
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: 1.2
7
  Author: Audrius Dobilinskas
8
  Author URI: http://onlineads.lt/
9
  */
18
  define('WP_PLUGIN_DIR', WP_CONTENT_DIR.'/plugins');
19
 
20
  function activate_google_universal_analytics() {
21
+ add_option('web_property_id', 'Paste your Google Universal Analytics tracking code here...');
22
  }
23
 
24
  function deactive_google_universal_analytics() {
41
  $web_property_id = get_option('web_property_id');
42
  ?>
43
 
44
+ <!-- Google Universal Analytics plugin for WordPress -->
45
+ <?php echo $web_property_id ?>
 
 
 
46
 
 
 
 
 
47
  <?php
48
  }
49
 
options.php CHANGED
@@ -1,21 +1,64 @@
1
  <div class="wrap">
 
2
  <h2>Google Universal Analytics</h2>
3
 
4
  <form method="post" action="options.php">
5
  <?php wp_nonce_field('update-options'); ?>
6
  <?php settings_fields('google_universal_analytics'); ?>
7
 
8
- <table class="form-table">
9
-
10
- <tr valign="top">
11
- <th scope="row">Web Property ID:</th>
12
- <td><input type="text" name="web_property_id" value="<?php echo get_option('web_property_id'); ?>" /></td>
13
- </tr>
14
-
15
- </tr>
16
-
17
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
  <input type="hidden" name="action" value="update" />
21
 
@@ -26,3 +69,5 @@
26
  </form>
27
  Have a question? Drop us a question at <a href="http://onlineads.lt/?utm_source=WordPress&utm_medium=Google+Universal+Analytics+-+Options+page&utm_campaign=WordPress+plugins" title="Google Universal Analytics">OnlineAds.lt</a>
28
  </div>
 
 
1
  <div class="wrap">
2
+
3
  <h2>Google Universal Analytics</h2>
4
 
5
  <form method="post" action="options.php">
6
  <?php wp_nonce_field('update-options'); ?>
7
  <?php settings_fields('google_universal_analytics'); ?>
8
 
9
+ <style type="text/css">
10
+ .tooltip {
11
+ border-bottom: 1px dotted #000000;
12
+ color: #000000; outline: none;
13
+ cursor: help; text-decoration: none;
14
+ position: relative;
15
+ }
16
+ .tooltip span {
17
+ margin-left: -999em;
18
+ position: absolute;
19
+ }
20
+ .tooltip:hover span {
21
+ font-family: Calibri, Tahoma, Geneva, sans-serif;
22
+ position: absolute;
23
+ left: 1em;
24
+ top: 2em;
25
+ z-index: 99;
26
+ margin-left: 0;
27
+ width: 450px;
28
+ }
29
+ .tooltip:hover img {
30
+ border: 0;
31
+ margin: -10px 0 0 -55px;
32
+ float: left;
33
+ position: absolute;
34
+ }
35
+ .tooltip:hover em {
36
+ font-family: Candara, Tahoma, Geneva, sans-serif;
37
+ font-size: 1.2em;
38
+ font-weight: bold;
39
+ display: block;
40
+ padding: 0.2em 0 0.6em 0;
41
+ }
42
+ .classic { padding: 0.8em 1em; }
43
+ .custom { padding: 0.5em 0.8em 0.8em 2em; }
44
+ * html a:hover { background: transparent; }
45
+ </style>
46
 
47
+ <p>Insert your Google Universal Analytics code below
48
+ <a class="tooltip" href="#">(Code Example)<span class="classic">
49
+ &lt;script&gt;</br>
50
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){</br>
51
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),</br>
52
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)</br>
53
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');</br>
54
+ </br>
55
+ ga('create', 'UA-23710779-8', 'onlineads.lt');</br>
56
+ ga('send', 'pageview');</br>
57
+ </br>
58
+ &lt;/script&gt;
59
+ </span></a>:</p>
60
+ <textarea name="web_property_id" id="web_property_id" rows="15" cols="65" >
61
+ <?php echo get_option('web_property_id'); ?> </textarea>
62
 
63
  <input type="hidden" name="action" value="update" />
64
 
69
  </form>
70
  Have a question? Drop us a question at <a href="http://onlineads.lt/?utm_source=WordPress&utm_medium=Google+Universal+Analytics+-+Options+page&utm_campaign=WordPress+plugins" title="Google Universal Analytics">OnlineAds.lt</a>
71
  </div>
72
+
73
+ </br>
readme.txt CHANGED
@@ -1,17 +1,17 @@
1
  === Google Universal Analytics ===
2
  Contributors: audriusd
3
  Donate link: http://onlineads.lt/
4
- Tags: javascript, tracking, google, analytics, universal, statistics, google analytics, universal analytics
5
  Requires at least: 2.7
6
- Tested up to: 3.5.1
7
- Stable tag: 1.1
8
  License: GPLv2 or later
9
 
10
  Adds the latest Google Universal Analytics JavaScript tracking code to your WordPress website.
11
 
12
  == Description ==
13
 
14
- Adding Google Analytics code to your website has never been easier. Simply add your Web Property ID and that's it.
15
 
16
  Why Google Universal Analytics is better than the usual Google Analytics?
17
 
@@ -27,7 +27,7 @@ For more information visit: [Google Analytics](http://www.google.com/analytics)
27
 
28
  1. Upload `google-universal-analytics` directory to the `/wp-content/plugins/` directory or use plugin search - Admin > Plugins > Add new > Search for 'Google Universal Analytics'.
29
  2. Activate the plugin through the 'Plugins' menu in WordPress
30
- 3. Add the web property ID from Google Analytics (UA-23710779-8, etc.) to the settings (Admin > Settings > Google Universal Analytics)
31
 
32
  == Frequently Asked Questions ==
33
 
@@ -36,7 +36,7 @@ For more information visit: [Google Analytics](http://www.google.com/analytics)
36
  Follow the link for step-by-step guide:
37
  [http://onlineads.lt/how-to-install-google-universal-analytics-for-your-wordpress-blog/](http://onlineads.lt/how-to-install-google-universal-analytics-for-your-wordpress-blog/)
38
 
39
- = How can I change Web Property ID? =
40
 
41
  The same way you entered it the first time: Admin > Settings > Google Universal Analytics
42
 
@@ -51,6 +51,9 @@ Also, do not hesitate to contact us if you have any questions regarding [Google
51
 
52
  == Changelog ==
53
 
 
 
 
54
  = 1.1 =
55
  * Minor fix in tracking code.
56
 
@@ -60,6 +63,9 @@ Also, do not hesitate to contact us if you have any questions regarding [Google
60
 
61
  == Upgrade Notice ==
62
 
 
 
 
63
  = 1.1 =
64
  Tracking code updated.
65
 
1
  === Google Universal Analytics ===
2
  Contributors: audriusd
3
  Donate link: http://onlineads.lt/
4
+ Tags: javascript, tracking, google, analytics, universal, statistics, google analytics, universal analytics, google universal analytics
5
  Requires at least: 2.7
6
+ Tested up to: 3.8
7
+ Stable tag: 1.2
8
  License: GPLv2 or later
9
 
10
  Adds the latest Google Universal Analytics JavaScript tracking code to your WordPress website.
11
 
12
  == Description ==
13
 
14
+ Adding Google Analytics code to your website has never been easier. Simply copy and paste your tracking code and that's it.
15
 
16
  Why Google Universal Analytics is better than the usual Google Analytics?
17
 
27
 
28
  1. Upload `google-universal-analytics` directory to the `/wp-content/plugins/` directory or use plugin search - Admin > Plugins > Add new > Search for 'Google Universal Analytics'.
29
  2. Activate the plugin through the 'Plugins' menu in WordPress
30
+ 3. Paste tracking code from Google Analytics to the settings (Admin > Settings > Google Universal Analytics)
31
 
32
  == Frequently Asked Questions ==
33
 
36
  Follow the link for step-by-step guide:
37
  [http://onlineads.lt/how-to-install-google-universal-analytics-for-your-wordpress-blog/](http://onlineads.lt/how-to-install-google-universal-analytics-for-your-wordpress-blog/)
38
 
39
+ = How can I update and modify the tracking code? =
40
 
41
  The same way you entered it the first time: Admin > Settings > Google Universal Analytics
42
 
51
 
52
  == Changelog ==
53
 
54
+ = 1.2 =
55
+ * Important: After updating enter full tracking code (not just Web Property ID).
56
+
57
  = 1.1 =
58
  * Minor fix in tracking code.
59
 
63
 
64
  == Upgrade Notice ==
65
 
66
+ = 1.2 =
67
+ * Important: Bug fixed. After updating enter full tracking code (not just Web Property ID).
68
+
69
  = 1.1 =
70
  Tracking code updated.
71