How to set up Google Analytics
In addition to b2evolution’s built-in Server Side Analytics, you may want to set up Google Analytics which may give you additional graphs regarding human visitors through the web.
Google Analytics cannot see robots, spiders, RSS readers, AJAX queries and service requests. Google Analytics also won’t let you see or identify spammers. Use b2evolution’s built-in Server Side Analytics to have a complete picture of hits on your website.
Google Analytics may be desirable if your b2evolution website, blog or forum are part of a vaster web presence which is globally tracked with Google Analytics.
Generate your tracking code snippet
The Google Analytics documentation about how to generate your tracking code snippet can be found here:
The code snippet will look something like this: (Note: the code provided by Google is frequently updated/optimized. So don’t worry if the one Google suggest is a bit different).
Insert your your tracking code snippet into b2evolution
Once you have your own snippet, you can simply insert it into the Advanced Collection Settings screen in the field named "Custom meta tag/css section (before </head>):".
Should I put the Analytics code before
</head> or before
</body>):") because the original method Google provided for loading
ga.js was blocking.
But with the latest versions of the analytics code (since 2009 – see code above), the snippet can safely be put in the head section with minimal blockage; so it is now perfectly fine and optimized to put it just before
Putting it before
</head> will still add a very little amount of latency, whereas putting it before
</body> will reduce the number of pageviews recorded at some small margin (e-g: if someone clicks on a link before your page is fully loaded). It’s a tradeoff.
ga.js is heavily cached by users and present on a large percentage of sites across the web, so its often served from the cache, reducing latency to almost nil. Therefore we recommend placing the snippet before
You can find a detailed explanation of how the code works here: https://developers.google.com/analytics/devguides/collection/gajs/
The above is the standard set up that most people use.
- Event Tracking: see:
- Custom variables:
- Site Speed tracking:
Created by • Last edit by on Jun 10, 2014