Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
drupal.org
google_analytics
Commits
22d7d665
Commit
22d7d665
authored
Mar 31, 2013
by
hass
Browse files
Updated to public beta tracker code
parent
2af9a9d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
googleanalytics.module
googleanalytics.module
+8
-9
No files found.
googleanalytics.module
View file @
22d7d665
...
...
@@ -233,12 +233,11 @@ function googleanalytics_page_alter(&$page) {
} */
// Build tracker code.
$script
=
'(function(q,u,i,c,k){'
;
$script
.
=
'window["GoogleAnalyticsObject"]=q;'
;
$script
.
=
'window[q]=window[q]||function(){'
;
$script
.
=
'(window[q].q=window[q].q||[]).push(arguments)},'
;
$script
.
=
'window[q].l=1*new Date();c=i.createElement(u),k=i.getElementsByTagName(u)[0];'
;
$script
.
=
'c.async=true;'
;
$script
=
'(function(i,s,o,g,r,a,m){'
;
$script
.
=
'i["GoogleAnalyticsObject"]=r;i[r]=i[r]||function(){'
;
$script
.
=
'(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),'
;
$script
.
=
'm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)'
;
$script
.
=
'})(window,document,"script",'
;
// Which version of the tracking library should be used?
$library_tracker_url
=
'//www.google-analytics.com/analytics.js'
;
...
...
@@ -252,12 +251,12 @@ function googleanalytics_page_alter(&$page) {
// URL changed.
$query_string
=
'?'
.
variable_get
(
'css_js_query_string'
,
'0'
);
$script
.
=
'
c.src=
"'
.
$url
.
$query_string
.
'"
;
'
;
$script
.
=
'"'
.
$url
.
$query_string
.
'"'
;
}
else
{
$script
.
=
'
c.src=
"'
.
$library_tracker_url
.
'"
;
'
;
$script
.
=
'"'
.
$library_tracker_url
.
'"'
;
}
$script
.
=
'
k.parentNode.insertBefore(c,k)})("ga","script",document
);'
;
$script
.
=
'
,"ga"
);'
;
// Create a tracker.
$script
.
=
'ga("create", '
.
drupal_json_encode
(
$id
)
.
');'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment