Commit 22d7d665 authored by hass's avatar hass
Browse files

Updated to public beta tracker code

parent 2af9a9d7
......@@ -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) . ');';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment