| Home »
Categories » Shared web hosting » General
How do I use Google Analytics for my Linux/IIS8 web hosting account?
Article Number: 2889 | Rating: 5/5 from 1 votes | Last Updated: Thu, Jul 16, 2015 9:29 PM
To use Google Analytics, you must do two things:
1. Create a Google Analytics account
2. Set up the web tracking code
1. Creating a Google Analytics account
• Go to the Google Analytics website. On the homepage, click the 'Create an account' button and follow the instructions on the screen.
• Please refer to the Google Analytics help pages if you have questions about the settings. Go to 'Manage Accounts, Users and Data'.
• To set Google Analytics for tracking an app, you can consult the 'Best Practices for Mobile App Analytics set up'.
2. Setting up the web tracking code
BEFORE YOU BEGIN:
To set up the tracking of data you must have access to the source code of your website. If you currently keep track of the data for your website using an older code snippet, remove this snippet from each page first, before you add the new one.
If you plan to make changes to your pages after you have added the new snippet, you can use a text or HTML editor to open and save a copy of each file.
The following procedure takes you through the process of adding the tracking code snippet to your site. First make sure you have already taken care of the following two things:
• You have an Analytics account and use it for this site.
• You have added your site as web property to the account you are using.
1. First seek the tracking code snippet for your property.
a) Click the 'Manage' link on any Analytics page.
b) Select the property you want to track.
c) Verify that URL shown above matches the URL of your website.
If the settings show the wrong web property, click the link in the breadcrumb trail for your account and select the desired web property from the list.
d) Click the 'Tracking info' tab:
You will see code similar to the snippet below, where XXXXX-Y is the property ID.
ga('create', 'UA-XXXXX-Y', 'auto');
2. Select the desired tracking options and then click 'Save'.
3. Copy and paste the code snippet:
When you find the code snippet, copy and paste it into your web page, just before the closing tag *. If your website uses templates to generate pages, add the snippet just before the closing tag in the file that contains the section. (Most websites use a single file for common content. If yours does, it is probably not necessary to place the code snippet on every page of your website.)
For optimal performance in all browsers we recommend that you place other scripts on your site in one of the following locations:
• before the tracking code snippet in the section of your HTML code
• after both the tracking code snippet and all the page content (e.g. below the HTML text).
4. Check and correct:
Make sure your tracking code contains the correct web property ID for your profile (this should be the case if you copied the web property from the 'Profile settings' screen). Recheck whether the tracking code placed on your website matches that in your profile. For more information about checking your settings, please visit the Google Analytics 'Checking your settings' pages.
5. Make any changes again using the asynchronous syntax. The Usage Guide and Migration Examples in Google Code contain many examples of changes to the asynchronous tracking code.
There are no attachments for this article.
There are no comments for this article. Be the first to post a comment.
What is shared web hosting?
Viewed 6624 times since Thu, Nov 27, 2008
What is data traffic?
Viewed 2093 times since Thu, Nov 27, 2008
Some tips for a secure site...
Viewed 18213 times since Wed, May 15, 2013