Google Analytics for WordPress by MonsterInsights - Version 2.2

Version Description

Download this release

Release Info

Developer joostdevalk
Plugin Icon 128x128 Google Analytics for WordPress by MonsterInsights
Version 2.2
Comparing to
See all releases

Code changes from version 2.1 to 2.2

gapp/adsense-track.js CHANGED
@@ -8,7 +8,7 @@ You are allowed to use this but you should keep this copyright notice here
8
 
9
  ******************************************************************************/
10
  function as_click () {
11
- urchinTracker ('/outbound/asclick');
12
  }
13
  if(typeof window.addEventListener != 'undefined') {
14
  window.addEventListener('load', adsense_init, false);
@@ -70,7 +70,7 @@ function doPageExit(e) {
70
  var inFrameX = (px > (adLeft - 10) && px < (parseInt(adLeft) + parseInt(ad[i].width) + 15));
71
  var inFrameY = (py > (adTop - 10) && py < (parseInt(adTop) + parseInt(ad[i].height) + 10));
72
  if (inFrameY && inFrameX) {
73
- urchinTracker('/outbound/asclick');
74
  }
75
  }
76
  }
8
 
9
  ******************************************************************************/
10
  function as_click () {
11
+ pageTracker._trackVisit('/outbound/asclick');
12
  }
13
  if(typeof window.addEventListener != 'undefined') {
14
  window.addEventListener('load', adsense_init, false);
70
  var inFrameX = (px > (adLeft - 10) && px < (parseInt(adLeft) + parseInt(ad[i].width) + 15));
71
  var inFrameY = (py > (adTop - 10) && py < (parseInt(adTop) + parseInt(ad[i].height) + 10));
72
  if (inFrameY && inFrameX) {
73
+ pageTracker._trackVisit('/outbound/asclick');
74
  }
75
  }
76
  }
gapp/custom_se.js CHANGED
@@ -7,148 +7,119 @@
7
  // Dutch Search Engines added by Joost de Valk (http://www.joostdevalk.nl)
8
  // For enquiries specifically about the Dutch SE's please contact joost@joostdevalk.nl
9
 
10
- var _uOsr=new Array();
11
- var _uOkw=new Array();
12
-
13
  // Google EMEA Image domains
14
- _uOsr[_uOsr.length]="images.google.co.uk"; _uOkw[_uOsr.length]="q";
15
- _uOsr[_uOsr.length]="images.google.es"; _uOkw[_uOsr.length]="q";
16
- _uOsr[_uOsr.length]="images.google.pt"; _uOkw[_uOsr.length]="q";
17
- _uOsr[_uOsr.length]="images.google.it"; _uOkw[_uOsr.length]="q";
18
- _uOsr[_uOsr.length]="images.google.fr"; _uOkw[_uOsr.length]="q";
19
- _uOsr[_uOsr.length]="images.google.nl"; _uOkw[_uOsr.length]="q";
20
- _uOsr[_uOsr.length]="images.google.be"; _uOkw[_uOsr.length]="q";
21
- _uOsr[_uOsr.length]="images.google.de"; _uOkw[_uOsr.length]="q";
22
- _uOsr[_uOsr.length]="images.google.no"; _uOkw[_uOsr.length]="q";
23
- _uOsr[_uOsr.length]="images.google.se"; _uOkw[_uOsr.length]="q";
24
- _uOsr[_uOsr.length]="images.google.dk"; _uOkw[_uOsr.length]="q";
25
- _uOsr[_uOsr.length]="images.google.fi"; _uOkw[_uOsr.length]="q";
26
- _uOsr[_uOsr.length]="images.google.ch"; _uOkw[_uOsr.length]="q";
27
- _uOsr[_uOsr.length]="images.google.at"; _uOkw[_uOsr.length]="q";
28
- _uOsr[_uOsr.length]="images.google.ie"; _uOkw[_uOsr.length]="q";
29
- _uOsr[_uOsr.length]="images.google.ru"; _uOkw[_uOsr.length]="q";
30
- _uOsr[_uOsr.length]="images.google.pl"; _uOkw[_uOsr.length]="q";
31
 
32
  // Other Google Image search
33
- _uOsr[_uOsr.length]="images.google.com"; _uOkw[_uOsr.length]="q";
34
- _uOsr[_uOsr.length]="images.google.ca"; _uOkw[_uOsr.length]="q";
35
- _uOsr[_uOsr.length]="images.google.com.au"; _uOkw[_uOsr.length]="q";
36
- _uOsr[_uOsr.length]="images.google"; _uOkw[_uOsr.length]="q";
37
 
38
  // Blogsearch
39
- _uOsr[_uOsr.length]="blogsearch.google"; _uOkw[_uOsr.length]="q";
40
 
41
  // Google EMEA Domains
42
- _uOsr[_uOsr.length]="google.co.uk"; _uOkw[_uOsr.length]="q";
43
- _uOsr[_uOsr.length]="google.es"; _uOkw[_uOsr.length]="q";
44
- _uOsr[_uOsr.length]="google.pt"; _uOkw[_uOsr.length]="q";
45
- _uOsr[_uOsr.length]="google.it"; _uOkw[_uOsr.length]="q";
46
- _uOsr[_uOsr.length]="google.fr"; _uOkw[_uOsr.length]="q";
47
- _uOsr[_uOsr.length]="google.nl"; _uOkw[_uOsr.length]="q";
48
- _uOsr[_uOsr.length]="google.be"; _uOkw[_uOsr.length]="q";
49
- _uOsr[_uOsr.length]="google.de"; _uOkw[_uOsr.length]="q";
50
- _uOsr[_uOsr.length]="google.no"; _uOkw[_uOsr.length]="q";
51
- _uOsr[_uOsr.length]="google.se"; _uOkw[_uOsr.length]="q";
52
- _uOsr[_uOsr.length]="google.dk"; _uOkw[_uOsr.length]="q";
53
- _uOsr[_uOsr.length]="google.fi"; _uOkw[_uOsr.length]="q";
54
- _uOsr[_uOsr.length]="google.ch"; _uOkw[_uOsr.length]="q";
55
- _uOsr[_uOsr.length]="google.at"; _uOkw[_uOsr.length]="q";
56
- _uOsr[_uOsr.length]="google.ie"; _uOkw[_uOsr.length]="q";
57
- _uOsr[_uOsr.length]="google.ru"; _uOkw[_uOsr.length]="q";
58
- _uOsr[_uOsr.length]="google.pl"; _uOkw[_uOsr.length]="q";
59
 
60
  // Yahoo EMEA Domains
61
- _uOsr[_uOsr.length]="uk.yahoo.com"; _uOkw[_uOsr.length]="p";
62
- _uOsr[_uOsr.length]="es.yahoo.com"; _uOkw[_uOsr.length]="p";
63
- _uOsr[_uOsr.length]="pt.yahoo.com"; _uOkw[_uOsr.length]="p";
64
- _uOsr[_uOsr.length]="it.yahoo.com"; _uOkw[_uOsr.length]="p";
65
- _uOsr[_uOsr.length]="fr.yahoo.com"; _uOkw[_uOsr.length]="p";
66
- _uOsr[_uOsr.length]="nl.yahoo.com"; _uOkw[_uOsr.length]="p";
67
- _uOsr[_uOsr.length]="be.yahoo.com"; _uOkw[_uOsr.length]="p";
68
- _uOsr[_uOsr.length]="de.yahoo.com"; _uOkw[_uOsr.length]="p";
69
- _uOsr[_uOsr.length]="no.yahoo.com"; _uOkw[_uOsr.length]="p";
70
- _uOsr[_uOsr.length]="se.yahoo.com"; _uOkw[_uOsr.length]="p";
71
- _uOsr[_uOsr.length]="dk.yahoo.com"; _uOkw[_uOsr.length]="p";
72
- _uOsr[_uOsr.length]="fi.yahoo.com"; _uOkw[_uOsr.length]="p";
73
- _uOsr[_uOsr.length]="ch.yahoo.com"; _uOkw[_uOsr.length]="p";
74
- _uOsr[_uOsr.length]="at.yahoo.com"; _uOkw[_uOsr.length]="p";
75
- _uOsr[_uOsr.length]="ie.yahoo.com"; _uOkw[_uOsr.length]="p";
76
- _uOsr[_uOsr.length]="ru.yahoo.com"; _uOkw[_uOsr.length]="p";
77
- _uOsr[_uOsr.length]="pl.yahoo.com"; _uOkw[_uOsr.length]="p";
78
 
79
  // UK specific
80
- _uOsr[_uOsr.length]="hotbot.co.uk"; _uOkw[_uOsr.length]="query";
81
- _uOsr[_uOsr.length]="excite.co.uk"; _uOkw[_uOsr.length]="q";
82
- _uOsr[_uOsr.length]="bbc"; _uOkw[_uOsr.length]="q";
83
- _uOsr[_uOsr.length]="tiscali"; _uOkw[_uOsr.length]="query";
84
- _uOsr[_uOsr.length]="uk.ask.com"; _uOkw[_uOsr.length]="q";
85
- _uOsr[_uOsr.length]="blueyonder"; _uOkw[_uOsr.length]="q";
86
- _uOsr[_uOsr.length]="search.aol.co.uk"; _uOkw[_uOsr.length]="query";
87
- _uOsr[_uOsr.length]="ntlworld"; _uOkw[_uOsr.length]="q";
88
- _uOsr[_uOsr.length]="tesco.net"; _uOkw[_uOsr.length]="q";
89
- _uOsr[_uOsr.length]="orange.co.uk"; _uOkw[_uOsr.length]="q";
90
- _uOsr[_uOsr.length]="mywebsearch.com"; _uOkw[_uOsr.length]="searchfor";
91
- _uOsr[_uOsr.length]="uk.myway.com"; _uOkw[_uOsr.length]="searchfor";
92
- _uOsr[_uOsr.length]="searchy.co.uk"; _uOkw[_uOsr.length]="search_term";
93
- _uOsr[_uOsr.length]="msn.co.uk"; _uOkw[_uOsr.length]="q";
94
- _uOsr[_uOsr.length]="uk.altavista.com"; _uOkw[_uOsr.length]="q";
95
- _uOsr[_uOsr.length]="lycos.co.uk"; _uOkw[_uOsr.length]="query";
96
 
97
  // NL specific
98
- _uOsr[_uOsr.length]="chello.nl"; _uOkw[_uOsr.length]="q1";
99
- _uOsr[_uOsr.length]="home.nl"; _uOkw[_uOsr.length]="q";
100
- _uOsr[_uOsr.length]="planet.nl"; _uOkw[_uOsr.length]="googleq=q";
101
- _uOsr[_uOsr.length]="search.ilse.nl"; _uOkw[_uOsr.length]="search_for";
102
- _uOsr[_uOsr.length]="search-dyn.tiscali.nl"; _uOkw[_uOsr.length]="key";
103
- _uOsr[_uOsr.length]="startgoogle.startpagina.nl"; _uOkw[_uOsr.length]="q";
104
- _uOsr[_uOsr.length]="vinden.nl"; _uOkw[_uOsr.length]="q";
105
- _uOsr[_uOsr.length]="vindex.nl"; _uOkw[_uOsr.length]="search_for";
106
- _uOsr[_uOsr.length]="zoeken.nl"; _uOkw[_uOsr.length]="query";
107
- _uOsr[_uOsr.length]="zoeken.track.nl"; _uOkw[_uOsr.length]="qr";
108
- _uOsr[_uOsr.length]="zoeknu.nl"; _uOkw[_uOsr.length]="Keywords";
109
 
110
  // Extras
111
- _uOsr[_uOsr.length]="alltheweb"; _uOkw[_uOsr.length]="q";
112
- _uOsr[_uOsr.length]="ananzi"; _uOkw[_uOsr.length]="qt";
113
- _uOsr[_uOsr.length]="anzwers"; _uOkw[_uOsr.length]="search";
114
- _uOsr[_uOsr.length]="araby.com"; _uOkw[_uOsr.length]="q";
115
- _uOsr[_uOsr.length]="dogpile"; _uOkw[_uOsr.length]="q";
116
- _uOsr[_uOsr.length]="elmundo.es"; _uOkw[_uOsr.length]="q";
117
- _uOsr[_uOsr.length]="ezilon.com"; _uOkw[_uOsr.length]="q";
118
- _uOsr[_uOsr.length]="hotbot"; _uOkw[_uOsr.length]="query";
119
- _uOsr[_uOsr.length]="indiatimes.com"; _uOkw[_uOsr.length]="query";
120
- _uOsr[_uOsr.length]="iafrica.funnel.co.za"; _uOkw[_uOsr.length]="q";
121
- _uOsr[_uOsr.length]="mywebsearch.com"; _uOkw[_uOsr.length]="searchfor";
122
- _uOsr[_uOsr.length]="rambler.ru"; _uOkw[_uOsr.length]="words";
123
- _uOsr[_uOsr.length]="search.aol.com"; _uOkw[_uOsr.length]="encquery";
124
- _uOsr[_uOsr.length]="search.indiatimes.com"; _uOkw[_uOsr.length]="query";
125
- _uOsr[_uOsr.length]="searcheurope.com"; _uOkw[_uOsr.length]="query";
126
- _uOsr[_uOsr.length]="suche.web.de"; _uOkw[_uOsr.length]="su";
127
- _uOsr[_uOsr.length]="terra.es"; _uOkw[_uOsr.length]="query";
128
- _uOsr[_uOsr.length]="voila.fr"; _uOkw[_uOsr.length]="kw";
129
-
130
- // Default GA (sorted)
131
- _uOsr[_uOsr.length]="about"; _uOkw[_uOsr.length]="terms";
132
- _uOsr[_uOsr.length]="alice"; _uOkw[_uOsr.length]="qs";
133
- _uOsr[_uOsr.length]="alltheweb"; _uOkw[_uOsr.length]="q";
134
- _uOsr[_uOsr.length]="altavista"; _uOkw[_uOsr.length]="q";
135
- _uOsr[_uOsr.length]="aol"; _uOkw[_uOsr.length]="encquery";
136
- _uOsr[_uOsr.length]="aol"; _uOkw[_uOsr.length]="query";
137
- _uOsr[_uOsr.length]="ask"; _uOkw[_uOsr.length]="q";
138
- _uOsr[_uOsr.length]="baidu"; _uOkw[_uOsr.length]="wd";
139
- _uOsr[_uOsr.length]="cnn"; _uOkw[_uOsr.length]="query";
140
- _uOsr[_uOsr.length]="gigablast"; _uOkw[_uOsr.length]="q";
141
- _uOsr[_uOsr.length]="google"; _uOkw[_uOsr.length]="q";
142
- _uOsr[_uOsr.length]="live.com"; _uOkw[_uOsr.length]="q";
143
- _uOsr[_uOsr.length]="looksmart"; _uOkw[_uOsr.length]="qt";
144
- _uOsr[_uOsr.length]="lycos"; _uOkw[_uOsr.length]="query";
145
- _uOsr[_uOsr.length]="mamma"; _uOkw[_uOsr.length]="query";
146
- _uOsr[_uOsr.length]="msn"; _uOkw[_uOsr.length]="q";
147
- _uOsr[_uOsr.length]="najdi"; _uOkw[_uOsr.length]="q";
148
- _uOsr[_uOsr.length]="netscape"; _uOkw[_uOsr.length]="s";
149
- _uOsr[_uOsr.length]="search"; _uOkw[_uOsr.length]="q";
150
- _uOsr[_uOsr.length]="seznam"; _uOkw[_uOsr.length]="w";
151
- _uOsr[_uOsr.length]="virgilio.it"; _uOkw[_uOsr.length]="qs";
152
- _uOsr[_uOsr.length]="voila.fr"; _uOkw[_uOsr.length]="kw";
153
- _uOsr[_uOsr.length]="yahoo"; _uOkw[_uOsr.length]="p";
154
- _uOsr[_uOsr.length]="yandex.ru"; _uOkw[_uOsr.length]="text";
7
  // Dutch Search Engines added by Joost de Valk (http://www.joostdevalk.nl)
8
  // For enquiries specifically about the Dutch SE's please contact joost@joostdevalk.nl
9
 
 
 
 
10
  // Google EMEA Image domains
11
+ pageTracker._addOrganic("images.google.co.uk","q");
12
+ pageTracker._addOrganic("images.google.es","q");
13
+ pageTracker._addOrganic("images.google.pt","q");
14
+ pageTracker._addOrganic("images.google.it","q");
15
+ pageTracker._addOrganic("images.google.fr","q");
16
+ pageTracker._addOrganic("images.google.nl","q");
17
+ pageTracker._addOrganic("images.google.be","q");
18
+ pageTracker._addOrganic("images.google.de","q");
19
+ pageTracker._addOrganic("images.google.no","q");
20
+ pageTracker._addOrganic("images.google.se","q");
21
+ pageTracker._addOrganic("images.google.dk","q");
22
+ pageTracker._addOrganic("images.google.fi","q");
23
+ pageTracker._addOrganic("images.google.ch","q");
24
+ pageTracker._addOrganic("images.google.at","q");
25
+ pageTracker._addOrganic("images.google.ie","q");
26
+ pageTracker._addOrganic("images.google.ru","q");
27
+ pageTracker._addOrganic("images.google.pl","q");
28
 
29
  // Other Google Image search
30
+ pageTracker._addOrganic("images.google.com","q");
31
+ pageTracker._addOrganic("images.google.ca","q");
32
+ pageTracker._addOrganic("images.google.com.au","q");
33
+ pageTracker._addOrganic("images.google","q");
34
 
35
  // Blogsearch
36
+ pageTracker._addOrganic("blogsearch.google","q");
37
 
38
  // Google EMEA Domains
39
+ pageTracker._addOrganic("google.co.uk","q");
40
+ pageTracker._addOrganic("google.es","q");
41
+ pageTracker._addOrganic("google.pt","q");
42
+ pageTracker._addOrganic("google.it","q");
43
+ pageTracker._addOrganic("google.fr","q");
44
+ pageTracker._addOrganic("google.nl","q");
45
+ pageTracker._addOrganic("google.be","q");
46
+ pageTracker._addOrganic("google.de","q");
47
+ pageTracker._addOrganic("google.no","q");
48
+ pageTracker._addOrganic("google.se","q");
49
+ pageTracker._addOrganic("google.dk","q");
50
+ pageTracker._addOrganic("google.fi","q");
51
+ pageTracker._addOrganic("google.ch","q");
52
+ pageTracker._addOrganic("google.at","q");
53
+ pageTracker._addOrganic("google.ie","q");
54
+ pageTracker._addOrganic("google.ru","q");
55
+ pageTracker._addOrganic("google.pl","q");
56
 
57
  // Yahoo EMEA Domains
58
+ pageTracker._addOrganic("uk.yahoo.com","p");
59
+ pageTracker._addOrganic("es.yahoo.com","p");
60
+ pageTracker._addOrganic("pt.yahoo.com","p");
61
+ pageTracker._addOrganic("it.yahoo.com","p");
62
+ pageTracker._addOrganic("fr.yahoo.com","p");
63
+ pageTracker._addOrganic("nl.yahoo.com","p");
64
+ pageTracker._addOrganic("be.yahoo.com","p");
65
+ pageTracker._addOrganic("de.yahoo.com","p");
66
+ pageTracker._addOrganic("no.yahoo.com","p");
67
+ pageTracker._addOrganic("se.yahoo.com","p");
68
+ pageTracker._addOrganic("dk.yahoo.com","p");
69
+ pageTracker._addOrganic("fi.yahoo.com","p");
70
+ pageTracker._addOrganic("ch.yahoo.com","p");
71
+ pageTracker._addOrganic("at.yahoo.com","p");
72
+ pageTracker._addOrganic("ie.yahoo.com","p");
73
+ pageTracker._addOrganic("ru.yahoo.com","p");
74
+ pageTracker._addOrganic("pl.yahoo.com","p");
75
 
76
  // UK specific
77
+ pageTracker._addOrganic("hotbot.co.uk","query");
78
+ pageTracker._addOrganic("excite.co.uk","q");
79
+ pageTracker._addOrganic("bbc","q");
80
+ pageTracker._addOrganic("tiscali","query");
81
+ pageTracker._addOrganic("uk.ask.com","q");
82
+ pageTracker._addOrganic("blueyonder","q");
83
+ pageTracker._addOrganic("search.aol.co.uk","query");
84
+ pageTracker._addOrganic("ntlworld","q");
85
+ pageTracker._addOrganic("tesco.net","q");
86
+ pageTracker._addOrganic("orange.co.uk","q");
87
+ pageTracker._addOrganic("mywebsearch.com","searchfor");
88
+ pageTracker._addOrganic("uk.myway.com","searchfor");
89
+ pageTracker._addOrganic("searchy.co.uk","search_term");
90
+ pageTracker._addOrganic("msn.co.uk","q");
91
+ pageTracker._addOrganic("uk.altavista.com","q");
92
+ pageTracker._addOrganic("lycos.co.uk","query");
93
 
94
  // NL specific
95
+ pageTracker._addOrganic("chello.nl","q1");
96
+ pageTracker._addOrganic("home.nl","q");
97
+ pageTracker._addOrganic("planet.nl","googleq=q");
98
+ pageTracker._addOrganic("search.ilse.nl","search_for");
99
+ pageTracker._addOrganic("search-dyn.tiscali.nl","key");
100
+ pageTracker._addOrganic("startgoogle.startpagina.nl","q");
101
+ pageTracker._addOrganic("vinden.nl","q");
102
+ pageTracker._addOrganic("vindex.nl","search_for");
103
+ pageTracker._addOrganic("zoeken.nl","query");
104
+ pageTracker._addOrganic("zoeken.track.nl","qr");
105
+ pageTracker._addOrganic("zoeknu.nl","Keywords");
106
 
107
  // Extras
108
+ pageTracker._addOrganic("alltheweb","q");
109
+ pageTracker._addOrganic("ananzi","qt");
110
+ pageTracker._addOrganic("anzwers","search");
111
+ pageTracker._addOrganic("araby.com","q");
112
+ pageTracker._addOrganic("dogpile","q");
113
+ pageTracker._addOrganic("elmundo.es","q");
114
+ pageTracker._addOrganic("ezilon.com","q");
115
+ pageTracker._addOrganic("hotbot","query");
116
+ pageTracker._addOrganic("indiatimes.com","query");
117
+ pageTracker._addOrganic("iafrica.funnel.co.za","q");
118
+ pageTracker._addOrganic("mywebsearch.com","searchfor");
119
+ pageTracker._addOrganic("rambler.ru","words");
120
+ pageTracker._addOrganic("search.aol.com","encquery");
121
+ pageTracker._addOrganic("search.indiatimes.com","query");
122
+ pageTracker._addOrganic("searcheurope.com","query");
123
+ pageTracker._addOrganic("suche.web.de","su");
124
+ pageTracker._addOrganic("terra.es","query");
125
+ pageTracker._addOrganic("voila.fr","kw");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
gapp/googleanalytics.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Google Analytics for WordPress
4
  Plugin URI: http://www.joostdevalk.nl/wordpress/analytics/
5
  Description: This plugin makes it simple to add Google Analytics with extra search engines and automatic clickout and download tracking to your WordPress blog.
6
  Author: Joost de Valk
7
- Version: 2.1
8
  Author URI: http://www.joostdevalk.nl/
9
  License: GPL
10
 
@@ -25,7 +25,7 @@ if ( ! class_exists( 'GA_Admin' ) ) {
25
  function add_config_page() {
26
  global $wpdb;
27
  if ( function_exists('add_submenu_page') ) {
28
- add_submenu_page('plugins.php', 'Google Analytics for WordPress Configuration', 'Google Analytics', 1, basename(__FILE__), array('GA_Admin','config_page'));
29
  }
30
  } // end add_GA_config_page()
31
 
@@ -52,21 +52,12 @@ if ( ! class_exists( 'GA_Admin' ) ) {
52
  if (isset($_POST['domainorurl']) && $_POST['domainorurl'] != "")
53
  $options['domainorurl'] = $_POST['domainorurl'];
54
 
55
- $options['position'] = $_POST['position'];
56
-
57
  if (isset($_POST['extrase'])) {
58
  $options['extrase'] = true;
59
  } else {
60
  $options['extrase'] = false;
61
  }
62
 
63
- if (isset($_POST['trackoutbound'])) {
64
- $options['trackoutbound'] = true;
65
- $options['position'] = 'header';
66
- } else {
67
- $options['trackoutbound'] = false;
68
- }
69
-
70
  if (isset($_POST['imagese'])) {
71
  $options['imagese'] = true;
72
  $options['extrase'] = true;
@@ -74,10 +65,10 @@ if ( ! class_exists( 'GA_Admin' ) ) {
74
  $options['imagese'] = false;
75
  }
76
 
77
- if (isset($_POST['yahooreffirst'])) {
78
- $options['yahooreffirst'] = true;
79
  } else {
80
- $options['yahooreffirst'] = false;
81
  }
82
 
83
  if (isset($_POST['admintracking'])) {
@@ -146,8 +137,15 @@ if ( ! class_exists( 'GA_Admin' ) ) {
146
  unique string that identifies the website you
147
  just defined, that is your User Account string
148
  (it's shown in <strong>bold</strong> in the example below).</p>
149
- <tt>&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;<br />&lt;/script&gt;<br />&lt;script type="text/javascript"&gt;<br />_uacct = "<strong><?php echo($mulch);?></strong>";<br />urchinTracker();<br />&lt;/script&gt;<br /></tt>
150
-
 
 
 
 
 
 
 
151
  <p>Once you have entered your User Account String in
152
  the box above your pages will be trackable by
153
  Google Analytics.</p>
@@ -178,13 +176,6 @@ if ( ! class_exists( 'GA_Admin' ) ) {
178
  <option value="url"<?php if ($options['domainorurl'] == 'url') { echo ' selected="selected"';} ?>>Track the complete URL</option>
179
  </select><br/>
180
  <br/>
181
- <?php } else { ?>
182
- <strong><label for="position">Place the script in the header or in the footer?</label></strong><br/>
183
- <select name="position" id="position" style="font-family: 'Courier New', Courier, mono; font-size: 1.5em;">
184
- <option value="header"<?php if ($options['position'] == 'header') { echo ' selected="selected"';} ?>>Header</option>
185
- <option value="footer"<?php if ($options['position'] == 'footer') { echo ' selected="selected"';} ?>>Footer</option>
186
- </select><br/>
187
- <br/>
188
  <?php } ?>
189
  <input type="checkbox" id="trackoutbound" name="trackoutbound" <?php if ($options['trackoutbound']) echo ' checked="checked" '; ?>/>
190
  <label for="trackoutbound">Track outbound clicks &amp; downloads</label><br/>
@@ -195,17 +186,11 @@ if ( ! class_exists( 'GA_Admin' ) ) {
195
  <input type="checkbox" id="extrase" name="extrase" <?php if ($options['extrase']) echo ' checked="checked" '; ?>/>
196
  <label for="extrase">Track extra Search Engines</label><br/>
197
  <br/>
198
- <input type="checkbox" id="imagese" name="imagese" <?php if ($options['imagese']) echo ' checked="checked" '; ?>/>
199
- <label for="imagese">Track Google Image search keywords (this needs the tracking of extra search engines too) (<a href="http://www.joostdevalk.nl/google-analytics-and-google-image-search-revisited/">more info</a>)</label><br/>
200
- <br/>
201
- <input type="checkbox" id="yahooreffirst" name="yahooreffirst" <?php if ($options['yahooreffirst']) echo ' checked="checked" '; ?>/>
202
- <label for="yahooreffirst">Track the keyword people used to search before they refined their search queries in Yahoo! (<a href="http://www.joostdevalk.nl/yahoos-search-assist-and-tracking-keywords/">more info</a>)</label><br/>
203
- <br/>
204
  <input type="checkbox" id="admintracking" name="admintracking" <?php if ($options['admintracking']) echo ' checked="checked" '; ?>/>
205
  <label for="admintracking">Track the administrator too (default is not to)</label>
206
  <br/>
207
  <input type="checkbox" id="userv2" name="userv2" <?php if ($options['userv2']) echo ' checked="checked" '; ?>/>
208
- <label for="userv2">I use Urchin too, so add <code>_userv = 2;</code></label>
209
  </p>
210
  <p class="submit"><input type="submit" name="submit" value="Update Settings &raquo;" /></p>
211
  </form>
@@ -236,7 +221,6 @@ if ( ! class_exists( 'GA_Admin' ) ) {
236
  $options['comautprefix'] = '/outbound/commentauthor';
237
  $options['blogrollprefix'] = '/outbound/blogroll';
238
  $options['domainorurl'] = 'domain';
239
- $options['position'] = 'header';
240
  $options['userv2'] = false;
241
  $options['extrase'] = false;
242
  $options['imagese'] = false;
@@ -247,7 +231,7 @@ if ( ! class_exists( 'GA_Admin' ) ) {
247
 
248
  function success() {
249
  echo "
250
- <div id='analytics-warning' class='updated fade-ff0000'><p><strong>Congratulations! You have just activated Google Analytics - take a look at the source of your blog pages and search for the word 'urchin' to see how your pages have been affected.</p></div>
251
  <style type='text/css'>
252
  #adminmenu { margin-bottom: 7em; }
253
  #analytics-warning { position: absolute; top: 7em; }
@@ -281,27 +265,32 @@ if ( ! class_exists( 'GA_Filter' ) ) {
281
  $opt = get_option('GoogleAnalyticsPP');
282
  $options = unserialize($opt);
283
 
284
- if ($options["uastring"] != "" && (!current_user_can('edit_users') || $options["admintracking"]) && !is_preview() ) {
285
- echo("\n\t<!-- Google Analytics for WordPress | http://www.joostdevalk.nl/wordpress/google-analytics/ -->\n");
286
- echo("\t<script src=\"http://www.google-analytics.com/urchin.js\" type=\"text/javascript\"></script>\n");
287
- if ( $options["extrase"] == true ) {
288
- echo("\t<script src=\"".get_bloginfo('wpurl')."/wp-content/plugins/gapp/custom_se.js\" type=\"text/javascript\"></script>\n");
289
- }
290
- if ( $options['imagese'] && $options['yahooreffirst']) {
291
- echo("\t<script src=\"".get_bloginfo('wpurl')."/wp-content/plugins/gapp/track-imagesearch-and-yahoo.js\" type=\"text/javascript\"></script>\n");
292
- } else if ( $options['imagese'] && !$options['yahooreffirst'] ) {
293
- echo("\t<script src=\"".get_bloginfo('wpurl')."/wp-content/plugins/gapp/track-imagesearch.js\" type=\"text/javascript\"></script>\n");
294
- } else if ( !$options['imagese'] && $options['yahooreffirst'] ) {
295
- echo("\t<script src=\"".get_bloginfo('wpurl')."/wp-content/plugins/gapp/track-yahoo.js\" type=\"text/javascript\"></script>\n");
296
- }
297
- echo("\t<script type=\"text/javascript\">\n");
298
- echo("\t\t_uacct = \"".$options["uastring"]."\";\n");
299
- if ( $options['userv2'] ) {
300
- echo("\t\t_userv=2;\n");
301
- }
302
- echo("\t\turchinTracker();\n");
303
- echo("\t</script>\n");
304
- echo("\t<!-- End of Google Analytics code -->\n\n");
 
 
 
 
 
305
  }
306
  }
307
 
@@ -324,18 +313,6 @@ if ( ! class_exists( 'GA_Filter' ) ) {
324
 
325
  }
326
 
327
- /* Take the result of parsing an HTML anchor ($matches)
328
- * and from that, extract the target domain. If the
329
- * target is not local, then when the anchor is re-written
330
- * then an urchinTracker call is added.
331
- *
332
- * the format of the outbound link is definedin the $leaf
333
- * variable which must begin with a / and which may
334
- * contain multiple path levels:
335
- * e.g. /outbound/x/y/z
336
- * or which may be just "/"
337
- *
338
- */
339
  function ga_parse_link($leaf, $matches){
340
  global $origin ;
341
 
@@ -348,14 +325,14 @@ if ( ! class_exists( 'GA_Filter' ) ) {
348
  $dlextensions = split(",",$options['dlextensions']);
349
  if ( $target["domain"] != $origin["domain"] ){
350
  if ($options['domainorurl'] == "domain") {
351
- $coolBit .= "onclick=\"javascript:urchinTracker('".$leaf."/".$target["host"]."');\"";
352
  } else if ($options['domainorurl'] == "url") {
353
- $coolBit .= "onclick=\"javascript:urchinTracker('".$leaf."/".$matches[2]."//".$matches[3]."');\"";
354
  }
355
  } else if ( in_array($extension, $dlextensions) && $target["domain"] == $origin["domain"] ) {
356
  $file = str_replace($origin["domain"],"",$matches[3]);
357
  $file = str_replace('www.',"",$file);
358
- $coolBit .= "onclick=\"javascript:urchinTracker('".$options['dlprefix'].$file."');\"";
359
  }
360
  return '<a href="' . $matches[2] . '//' . $matches[3] . '"' . $matches[1] . $matches[4] . ' '.$coolBit.'>' . $matches[5] . '</a>';
361
  }
@@ -402,9 +379,9 @@ if ( ! class_exists( 'GA_Filter' ) ) {
402
  $origin = GA_Filter::ga_get_domain($_SERVER["HTTP_HOST"]);
403
  if ( $target["domain"] != $origin["domain"] ){
404
  if ($options['domainorurl'] == "domain") {
405
- $coolBit .= "onclick=\"javascript:urchinTracker('".$options['comautprefix']."/".$target["host"]."');\"";
406
  } else if ($options['domainorurl'] == "url") {
407
- $coolBit .= "onclick=\"javascript:urchinTracker('".$options['comautprefix']."/".$matches[2]."');\"";
408
  }
409
  }
410
  return $matches[1] . "\"" . $matches[2] . "\" " . $coolBit ." ". $matches[3];
@@ -421,9 +398,9 @@ if ( ! class_exists( 'GA_Filter' ) ) {
421
  foreach ( (array) $bookmarks as $bookmark ) {
422
  if ($options['domainorurl'] == "domain") {
423
  $target = GA_Filter::ga_get_domain($bookmark->link_url);
424
- $bookmark->link_rel = $bookmark->link_rel."\" onclick=\"javascript:urchinTracker('".$options['blogrollprefix']."/".$target["host"]."');\"";
425
  } else if ($options['domainorurl'] == "url") {
426
- $bookmark->link_rel = $bookmark->link_rel."\" onclick=\"javascript:urchinTracker('".$options['blogrollprefix']."/".$bookmark->link_url."');\"";
427
  }
428
  }
429
  }
@@ -471,12 +448,6 @@ if ($opt == "") {
471
  // adds the menu item to the admin interface
472
  add_action('admin_menu', array('GA_Admin','add_config_page'));
473
 
474
- // adds the footer so the javascript is loaded
475
- if ($options['position'] =='footer') {
476
- add_action('wp_footer', array('GA_Filter','spool_analytics'));
477
- } else if ($options['position'] =='header') {
478
- add_action('wp_head', array('GA_Filter','spool_analytics'));
479
- }
480
  if ($options['trackoutbound']) {
481
  // filters alter the existing content
482
  add_filter('the_content', array('GA_Filter','the_content'), 99);
@@ -488,4 +459,11 @@ if ($options['trackoutbound']) {
488
  if ($options['trackadsense']) {
489
  add_action('wp_footer', array('GA_Filter','track_adsense'));
490
  }
491
- ?>
 
 
 
 
 
 
 
4
  Plugin URI: http://www.joostdevalk.nl/wordpress/analytics/
5
  Description: This plugin makes it simple to add Google Analytics with extra search engines and automatic clickout and download tracking to your WordPress blog.
6
  Author: Joost de Valk
7
+ Version: 2.2
8
  Author URI: http://www.joostdevalk.nl/
9
  License: GPL
10
 
25
  function add_config_page() {
26
  global $wpdb;
27
  if ( function_exists('add_submenu_page') ) {
28
+ add_submenu_page('plugins.php', 'Google Analytics for WordPress Configuration', 'Google Analytics', 9, basename(__FILE__), array('GA_Admin','config_page'));
29
  }
30
  } // end add_GA_config_page()
31
 
52
  if (isset($_POST['domainorurl']) && $_POST['domainorurl'] != "")
53
  $options['domainorurl'] = $_POST['domainorurl'];
54
 
 
 
55
  if (isset($_POST['extrase'])) {
56
  $options['extrase'] = true;
57
  } else {
58
  $options['extrase'] = false;
59
  }
60
 
 
 
 
 
 
 
 
61
  if (isset($_POST['imagese'])) {
62
  $options['imagese'] = true;
63
  $options['extrase'] = true;
65
  $options['imagese'] = false;
66
  }
67
 
68
+ if (isset($_POST['trackoutbound'])) {
69
+ $options['trackoutbound'] = true;
70
  } else {
71
+ $options['trackoutbound'] = false;
72
  }
73
 
74
  if (isset($_POST['admintracking'])) {
137
  unique string that identifies the website you
138
  just defined, that is your User Account string
139
  (it's shown in <strong>bold</strong> in the example below).</p>
140
+ <tt>&lt;script type="text/javascript"&gt;<br/>
141
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");<br/>
142
+ document.write("\&lt;script src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'&gt;\&lt;\/script&gt;" );<br/>
143
+ &lt;/script&gt;<br/>
144
+ &lt;script type="text/javascript"&gt;<br/>
145
+ var pageTracker = _gat._getTracker("<strong><?php echo($mulch);?></strong>");<br/>
146
+ pageTracker._initData();<br/>
147
+ pageTracker._trackPageview();<br/>
148
+ &lt;/script&gt;</tt>
149
  <p>Once you have entered your User Account String in
150
  the box above your pages will be trackable by
151
  Google Analytics.</p>
176
  <option value="url"<?php if ($options['domainorurl'] == 'url') { echo ' selected="selected"';} ?>>Track the complete URL</option>
177
  </select><br/>
178
  <br/>
 
 
 
 
 
 
 
179
  <?php } ?>
180
  <input type="checkbox" id="trackoutbound" name="trackoutbound" <?php if ($options['trackoutbound']) echo ' checked="checked" '; ?>/>
181
  <label for="trackoutbound">Track outbound clicks &amp; downloads</label><br/>
186
  <input type="checkbox" id="extrase" name="extrase" <?php if ($options['extrase']) echo ' checked="checked" '; ?>/>
187
  <label for="extrase">Track extra Search Engines</label><br/>
188
  <br/>
 
 
 
 
 
 
189
  <input type="checkbox" id="admintracking" name="admintracking" <?php if ($options['admintracking']) echo ' checked="checked" '; ?>/>
190
  <label for="admintracking">Track the administrator too (default is not to)</label>
191
  <br/>
192
  <input type="checkbox" id="userv2" name="userv2" <?php if ($options['userv2']) echo ' checked="checked" '; ?>/>
193
+ <label for="userv2">I use Urchin too, make it both work.</label>
194
  </p>
195
  <p class="submit"><input type="submit" name="submit" value="Update Settings &raquo;" /></p>
196
  </form>
221
  $options['comautprefix'] = '/outbound/commentauthor';
222
  $options['blogrollprefix'] = '/outbound/blogroll';
223
  $options['domainorurl'] = 'domain';
 
224
  $options['userv2'] = false;
225
  $options['extrase'] = false;
226
  $options['imagese'] = false;
231
 
232
  function success() {
233
  echo "
234
+ <div id='analytics-warning' class='updated fade-ff0000'><p><strong>Congratulations! You have just activated Google Analytics.</p></div>
235
  <style type='text/css'>
236
  #adminmenu { margin-bottom: 7em; }
237
  #analytics-warning { position: absolute; top: 7em; }
265
  $opt = get_option('GoogleAnalyticsPP');
266
  $options = unserialize($opt);
267
 
268
+ if ($options["uastring"] != "" && (!current_user_can('edit_users') || $options["admintracking"]) && !is_preview() ) { ?>
269
+ <!-- Google Analytics for WordPress | http://www.joostdevalk.nl/wordpress/google-analytics/ -->
270
+ <script type="text/javascript">
271
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
272
+ document.write("\<script src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'>\<\/script>" );
273
+ </script>
274
+ <script type="text/javascript">
275
+ var pageTracker = _gat._getTracker("<?php echo $options["uastring"]; ?>");
276
+ </script>
277
+ <?php if ( $options["extrase"] == true ) {
278
+ echo("\t<script src=\"".get_bloginfo('wpurl')."/wp-content/plugins/gapp/custom_se.js\" type=\"text/javascript\"></script>\n");
279
+ } ?>
280
+ <script type="text/javascript">
281
+ <?php if ( $options['userv2'] ) {
282
+ echo("\tpageTracker._setLocalRemoteServerMode();");
283
+ } ?>
284
+ pageTracker._initData();
285
+ <?php if (strpos($_SERVER['HTTP_REFERER'],"images.google") && strpos($_SERVER['HTTP_REFERER'],"&prev") && $options["imagese"]) { ?>
286
+ regex = new RegExp("images.google.([^\/]+).*&prev=([^&]+)");
287
+ var match = regex.exec(pageTracker.qa);
288
+ pageTracker.qa = "http://images.google." + match[1] + unescape(match[2]);
289
+ <?php } ?>
290
+ pageTracker._trackPageview();
291
+ </script>
292
+ <!-- End of Google Analytics code -->
293
+ <?php
294
  }
295
  }
296
 
313
 
314
  }
315
 
 
 
 
 
 
 
 
 
 
 
 
 
316
  function ga_parse_link($leaf, $matches){
317
  global $origin ;
318
 
325
  $dlextensions = split(",",$options['dlextensions']);
326
  if ( $target["domain"] != $origin["domain"] ){
327
  if ($options['domainorurl'] == "domain") {
328
+ $coolBit .= "onclick=\"javascript:pageTracker._trackVisit('".$leaf."/".$target["host"]."');\"";
329
  } else if ($options['domainorurl'] == "url") {
330
+ $coolBit .= "onclick=\"javascript:pageTracker._trackVisit('".$leaf."/".$matches[2]."//".$matches[3]."');\"";
331
  }
332
  } else if ( in_array($extension, $dlextensions) && $target["domain"] == $origin["domain"] ) {
333
  $file = str_replace($origin["domain"],"",$matches[3]);
334
  $file = str_replace('www.',"",$file);
335
+ $coolBit .= "onclick=\"javascript:pageTracker._trackVisit('".$options['dlprefix'].$file."');\"";
336
  }
337
  return '<a href="' . $matches[2] . '//' . $matches[3] . '"' . $matches[1] . $matches[4] . ' '.$coolBit.'>' . $matches[5] . '</a>';
338
  }
379
  $origin = GA_Filter::ga_get_domain($_SERVER["HTTP_HOST"]);
380
  if ( $target["domain"] != $origin["domain"] ){
381
  if ($options['domainorurl'] == "domain") {
382
+ $coolBit .= "onclick=\"javascript:pageTracker._trackVisit('".$options['comautprefix']."/".$target["host"]."');\"";
383
  } else if ($options['domainorurl'] == "url") {
384
+ $coolBit .= "onclick=\"javascript:pageTracker._trackVisit('".$options['comautprefix']."/".$matches[2]."');\"";
385
  }
386
  }
387
  return $matches[1] . "\"" . $matches[2] . "\" " . $coolBit ." ". $matches[3];
398
  foreach ( (array) $bookmarks as $bookmark ) {
399
  if ($options['domainorurl'] == "domain") {
400
  $target = GA_Filter::ga_get_domain($bookmark->link_url);
401
+ $bookmark->link_rel = $bookmark->link_rel."\" onclick=\"javascript:pageTracker._trackVisit('".$options['blogrollprefix']."/".$target["host"]."');\"";
402
  } else if ($options['domainorurl'] == "url") {
403
+ $bookmark->link_rel = $bookmark->link_rel."\" onclick=\"javascript:pageTracker._trackVisit('".$options['blogrollprefix']."/".$bookmark->link_url."');\"";
404
  }
405
  }
406
  }
448
  // adds the menu item to the admin interface
449
  add_action('admin_menu', array('GA_Admin','add_config_page'));
450
 
 
 
 
 
 
 
451
  if ($options['trackoutbound']) {
452
  // filters alter the existing content
453
  add_filter('the_content', array('GA_Filter','the_content'), 99);
459
  if ($options['trackadsense']) {
460
  add_action('wp_footer', array('GA_Filter','track_adsense'));
461
  }
462
+
463
+ // adds the footer so the javascript is loaded
464
+ add_action('wp_head', array('GA_Filter','spool_analytics'));
465
+
466
+ if ($options['trackadsense']) {
467
+ add_action('wp_footer', array('GA_Filter','track_adsense'));
468
+ }
469
+ ?>
gapp/track-imagesearch-and-yahoo.js DELETED
@@ -1,52 +0,0 @@
1
- function _uInfo(page) {
2
- var p,s="",dm="",pg=_udl.pathname+_udl.search;
3
- if (page && page!="") pg=_uES(page,1);
4
- if (_ubd.referrer.search(/search.yahoo/) != -1 && _ubd.referrer.search(/&rp=/) != -1) {
5
- var ref = _ubd.referrer;
6
- var pkwregex = new RegExp("&rp=([^&]+)");
7
- var pkw = pkwregex.exec(ref);
8
- var kwregex = new RegExp("&p=([^&]+)");
9
- var kw = kwregex.exec(ref);
10
- var tldregex = new RegExp("search.yahoo.([^\/]+)");
11
- var tldmatch = tldregex.exec(ref);
12
- _ur = "http://search.yahoo." + tldmatch[1] + "/search?p=" + kw[1] + "%20[" +pkw[1] +"]";
13
- } else if (_ubd.referrer.search(/images.google/) != -1) {
14
- var ref = _ubd.referrer;
15
- var tldregex = new RegExp("images.google.([^\/]+)");
16
- var tldmatch = tldregex.exec(ref);
17
- var imgregex = new RegExp("&prev=([^&]+)");
18
- var refmatch = imgregex.exec(ref);
19
- refmatch = refmatch[1].replace(/%26/g,"&");
20
- refmatch = refmatch.replace(/%3F/g,"?");
21
- refmatch = refmatch.replace(/%3D/g,"=");
22
- _ur = "http://www.images.google." + tldmatch[1] + refmatch;
23
- } else {
24
- _ur=_ubd.referrer;
25
- }
26
- if (!_ur || _ur=="") { _ur="-"; }
27
- else {
28
- dm=_ubd.domain;
29
- if(_utcp && _utcp!="/") dm+=_utcp;
30
- p=_ur.indexOf(dm);
31
- if ((p>=0) && (p<=8)) { _ur="0"; }
32
- if (_ur.indexOf("[")==0 && _ur.lastIndexOf("]")==(_ur.length-1)) { _ur="-"; }
33
- }
34
- s+="&utmn="+_uu;
35
- if (_ufsc) s+=_uBInfo();
36
- if (_uctm) s+=_uCInfo();
37
- if (_utitle && _ubd.title && _ubd.title!="") s+="&utmdt="+_uES(_ubd.title);
38
- if (_udl.hostname && _udl.hostname!="") s+="&utmhn="+_uES(_udl.hostname);
39
- s+="&utmr="+_ur;
40
- s+="&utmp="+pg;
41
- if ((_userv==0 || _userv==2) && _uSP()) {
42
- var i=new Image(1,1);
43
- i.src=_ugifpath+"?"+"utmwv="+_uwv+s;
44
- i.onload=function() {_uVoid();}
45
- }
46
- if ((_userv==1 || _userv==2) && _uSP()) {
47
- var i2=new Image(1,1);
48
- i2.src=_ugifpath2+"?"+"utmwv="+_uwv+s+"&utmac="+_uacct+"&utmcc="+_uGCS();
49
- i2.onload=function() { _uVoid(); }
50
- }
51
- return;
52
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
gapp/track-imagesearch.js DELETED
@@ -1,43 +0,0 @@
1
- function _uInfo(page) {
2
- var p,s="",dm="",pg=_udl.pathname+_udl.search;
3
- if (page && page!="") pg=_uES(page,1);
4
- if (_ubd.referrer.search(/images.google/) != -1) {
5
- var ref = _ubd.referrer;
6
- var tldregex = new RegExp("images.google.([^\/]+)");
7
- var tldmatch = tldregex.exec(ref);
8
- var imgregex = new RegExp("&prev=([^&]+)");
9
- var refmatch = imgregex.exec(ref);
10
- refmatch = refmatch[1].replace(/%26/g,"&");
11
- refmatch = refmatch.replace(/%3F/g,"?");
12
- refmatch = refmatch.replace(/%3D/g,"=");
13
- _ur = "http://www.images.google." + tldmatch[1] + refmatch;
14
- } else {
15
- _ur=_ubd.referrer;
16
- }
17
- if (!_ur || _ur=="") { _ur="-"; }
18
- else {
19
- dm=_ubd.domain;
20
- if(_utcp && _utcp!="/") dm+=_utcp;
21
- p=_ur.indexOf(dm);
22
- if ((p>=0) && (p<=8)) { _ur="0"; }
23
- if (_ur.indexOf("[")==0 && _ur.lastIndexOf("]")==(_ur.length-1)) { _ur="-"; }
24
- }
25
- s+="&utmn="+_uu;
26
- if (_ufsc) s+=_uBInfo();
27
- if (_uctm) s+=_uCInfo();
28
- if (_utitle && _ubd.title && _ubd.title!="") s+="&utmdt="+_uES(_ubd.title);
29
- if (_udl.hostname && _udl.hostname!="") s+="&utmhn="+_uES(_udl.hostname);
30
- s+="&utmr="+_ur;
31
- s+="&utmp="+pg;
32
- if ((_userv==0 || _userv==2) && _uSP()) {
33
- var i=new Image(1,1);
34
- i.src=_ugifpath+"?"+"utmwv="+_uwv+s;
35
- i.onload=function() {_uVoid();}
36
- }
37
- if ((_userv==1 || _userv==2) && _uSP()) {
38
- var i2=new Image(1,1);
39
- i2.src=_ugifpath2+"?"+"utmwv="+_uwv+s+"&utmac="+_uacct+"&utmcc="+_uGCS();
40
- i2.onload=function() { _uVoid(); }
41
- }
42
- return;
43
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
gapp/track-yahoo.js DELETED
@@ -1,42 +0,0 @@
1
- function _uInfo(page) {
2
- var p,s="",dm="",pg=_udl.pathname+_udl.search;
3
- if (page && page!="") pg=_uES(page,1);
4
- if (_ubd.referrer.search(/search.yahoo/) != -1 && _ubd.referrer.search(/&rp=/) != -1) {
5
- var ref = _ubd.referrer;
6
- var pkwregex = new RegExp("&rp=([^&]+)");
7
- var pkw = pkwregex.exec(ref);
8
- var kwregex = new RegExp("&p=([^&]+)");
9
- var kw = kwregex.exec(ref);
10
- var tldregex = new RegExp("search.yahoo.([^\/]+)");
11
- var tldmatch = tldregex.exec(ref);
12
- _ur = "http://search.yahoo." + tldmatch[1] + "/search?p=" + kw[1] + "%20[" +pkw[1] +"]";
13
- } else {
14
- _ur=_ubd.referrer;
15
- }
16
- if (!_ur || _ur=="") { _ur="-"; }
17
- else {
18
- dm=_ubd.domain;
19
- if(_utcp && _utcp!="/") dm+=_utcp;
20
- p=_ur.indexOf(dm);
21
- if ((p>=0) && (p<=8)) { _ur="0"; }
22
- if (_ur.indexOf("[")==0 && _ur.lastIndexOf("]")==(_ur.length-1)) { _ur="-"; }
23
- }
24
- s+="&utmn="+_uu;
25
- if (_ufsc) s+=_uBInfo();
26
- if (_uctm) s+=_uCInfo();
27
- if (_utitle && _ubd.title && _ubd.title!="") s+="&utmdt="+_uES(_ubd.title);
28
- if (_udl.hostname && _udl.hostname!="") s+="&utmhn="+_uES(_udl.hostname);
29
- s+="&utmr="+_ur;
30
- s+="&utmp="+pg;
31
- if ((_userv==0 || _userv==2) && _uSP()) {
32
- var i=new Image(1,1);
33
- i.src=_ugifpath+"?"+"utmwv="+_uwv+s;
34
- i.onload=function() {_uVoid();}
35
- }
36
- if ((_userv==1 || _userv==2) && _uSP()) {
37
- var i2=new Image(1,1);
38
- i2.src=_ugifpath2+"?"+"utmwv="+_uwv+s+"&utmac="+_uacct+"&utmcc="+_uGCS();
39
- i2.onload=function() { _uVoid(); }
40
- }
41
- return;
42
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.joostdevalk.nl/donate/
4
  Tags: analytics, google analytics, statistics
5
  Requires at least: 2.2
6
  Tested up to: 2.3.1
7
- Stable tag: 2.1
8
 
9
  The Google Analytics for WordPress plugina automatically tracks and segments all outbound links from within posts, comment author links, links within comments, blogroll links and downloads. It also allows you to track AdSense clicks, add extra search engines, track image search queries and it will even work together with Urchin.
10
 
@@ -22,12 +22,14 @@ In the options panel for the plugin, you can determine the prefixes to use for t
22
 
23
  This section describes how to install the plugin and get it working.
24
 
 
25
  1. Upload `gapp` folder to the `/wp-content/plugins/` directory
26
  1. Activate the plugin through the 'Plugins' menu in WordPress
27
  1. Go to the options panel under the 'Plugins' menu and add your Analytics account number and set the settings you want.
28
 
29
  == Changelog ==
30
 
 
31
  2.1: made sure tracking was disabled on preview pages
32
  2.0: added AdSense tracking
33
  1.5: added option to enable admin tracking, off by default
4
  Tags: analytics, google analytics, statistics
5
  Requires at least: 2.2
6
  Tested up to: 2.3.1
7
+ Stable tag: 2.2
8
 
9
  The Google Analytics for WordPress plugina automatically tracks and segments all outbound links from within posts, comment author links, links within comments, blogroll links and downloads. It also allows you to track AdSense clicks, add extra search engines, track image search queries and it will even work together with Urchin.
10
 
22
 
23
  This section describes how to install the plugin and get it working.
24
 
25
+ 1. Delete any existing `gapp` folder from the `/wp-content/plugins/` directory
26
  1. Upload `gapp` folder to the `/wp-content/plugins/` directory
27
  1. Activate the plugin through the 'Plugins' menu in WordPress
28
  1. Go to the options panel under the 'Plugins' menu and add your Analytics account number and set the settings you want.
29
 
30
  == Changelog ==
31
 
32
+ 2.2: switched to the new tracking code
33
  2.1: made sure tracking was disabled on preview pages
34
  2.0: added AdSense tracking
35
  1.5: added option to enable admin tracking, off by default