Track Visitors to Your Bryght Site With Google Analytics
Saying that Google Analytics is a website hit counter is like saying a Ferrari is a car. While technically true, Google Analytics does hit count tracking, referring tracking, it also does much more, like goal conversion tracking and search phrase and keyword tracking, with detailed reporting. Every new Bryght site comes with a module that adds the code Google Analytics needs to track visits and analyze the visits and present the data graphically. The module also includes some refined options like tracking only certain users and data based on what users put in their profiles.
Getting your Google Analytics Account Number
To track visitors on your site, you will need to know your Google Analytics account number.
- If you haven't already, visit Google Analytics and sign up for an account. If you have an existing account, sign in.
- Add Website Profile
- Add a Profile for a new domain
- Type in the URL of your site.
- Select your country and time zone
- Google Analytics will give you some code to track your site. (You will not need this code, but rather the account number within the code.) It will look something like this:
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-1234567-8";
urchinTracker();
</script> - Using the above example, the account number you would need for the Google Analytics module would be UA-1234567-8. Copy that part of the code to your clipboard.
- Paste the account number into your Google Analytics settings. See the section below.
Configuring Google Analytics
- In your site, enable the Google Analytics module. This can be done under Administer » Site building » Modules.
- Set the permissions for the Google Analytics module under Administer » User management » Access control. You will likely want to make sure administrators have the "administer google analytics" permission.
- Click Administer » Site configuration » Google Analytics
- Insert your Google Analytics account number. You can get your account number from the steps outlined above.
- Under "User specific tracking settings" choose whether users can opt out, opt in, or force tracking.
- Select roles you wish to track.
- All the roles on the system will have a checkbox, and boxes without a checkmark will not have their navigation on the site tracked.
- Under "Page specific tracking settings" you can select where tracking occurs. By default, it does not track administration pages, user profile pages, node creation pages, or node edit pages. Under these settings, it will track every other page on the site (subject to the role tracking, of course).
- If you have the Profile module enabled (which administrators can use to create custom user profile fields), then you will see a list of the profile fields available under "User Segmentation". If you select one or more fields in this list, tracking will only be enabled for users who have filled in values for those fields.
- for example, if you select "Username", in Google Analytics you can click Marketing Optimization, then Visitor Segment Performance, then User-defined and see tracking reports on a per-username basis.
- Under "Link tracking settings", you can select whether links get tracked, and which file extensions get tracking. The list of file extensions must be separated by the pipe "|" character. For example, "mov|avi" (without quotes) will track all clicks of files with the extensions .mov and .avi, but not other file link clicks.
- In the Advanced section, you can:
- which tracking code to use. We recommend using the ga.js tracking code as it will get you more and better tracking data.
- whether to cache the Javascript file. This will cut down on the amount of data downloaded from Google (i.e. the tracking Javascript file), and will still notify Google to keep stats.
- whether to track internal search. This will only work if you have the Search module enabled.
- add Javascript to pages that get tracked by Google Analytics. This is useful if you want to use an additional hit count tracking service to track visits to your site in addition to Google Analytics.
- where to put the Javascript tracking code. We recommend keeping in the footer so that it loads last after your content has loaded.