Advanced Google Analytics JavaScript Snippets
Last modified: August 21, 2009 - 20:34
Google Analytics module provides an advanced textarea on the settings page for including additional JavaScript to every page.
The official documentation about Google Analytics Tracking Code should be read first to understand how Google tracking works in general. On the Google Analytics Tracking API page you will find all available methods that can be used in this textarea. Additional you'll find JavaScript snippets dotted around in the Google Analytics Help Center.
Don't forget to prefix all used methods with pageTracker. as also shown below.
Add your Google Analytics advanced JavaScript snippets as comments to this page.

Tracking across multiple subdomains
GA allows for tracking across multiple subdomains using a single line of script.
pageTracker._setDomainName("example.com");See Further information for details.
no, it's
no, it's this:
pageTracker._setDomainName(".example.com");you missed the first period before the domain name.
Identify additional search engines in the Referral reports
By default, Google Analytics tracks referrals from a growing list of search engines. You can also configure Analytics to identify referrals from additional search engines by adding the following line to your tracking code:
pageTracker._addOrganic("name_of_searchengine","q_var");See here for more information.
Google Analytics without Javascript
Hi... I was just wondering if anybody knows anything about posting data on google analytics without using javascript? Any advice would be really appreciated... Thanks.
Google Analytics without
Google Analytics without Javascript? no.
You must provide date over an request and this can only be done by javascript on a page impression
It's me, BENNOS.
Google Script
Google proposes this script:
<script type="text/javascript">var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-yourcodexxxx");
pageTracker._trackPageview();
} catch(err) {}</script>
What goes before and what goes after and how should it look in drupal? Without script tags?
all the best
HB
Use the Google Analytics
You need to read http://code.google.com/intl/de-DE/apis/analytics/docs/gaJSApi.html what need to come "before"
pageTracker._trackPageview(), but it is nearly everything... except E-commerce stuff and multi account tracking.How to get 2 scripts of analytics?
I want track 2 separate codes. How can I do this?