Google Analytics Integration

Google Analytics is a site traffic monitoring system developed and maintained by Google. The tool works by adding a few lines of JavaScript code to all of the pages on your site and then reporting each hit to the Google Analytics server where you can view detailed graphs and statistics and see trends in site traffic.

On Shared hosting accounts, HostGator offers seamless integration with Google Analytics by adding this JavaScript code to your pages for you. Your site's content will not be modified in any way; instead, each time a page request is made, the JavaScript code will be dynamically added to the page before it is sent to your visitor.

To learn more about what Google Analytics can do for you, take the official product tour at:


How to Configure Google Analytics for a Domain

To configure Google Analytics for your domain:

  1. Log into cPanel.
  2. In the Logs section, click on the Google Analytics Integration icon.
  3. Under Domain to Configure, select the domain to which you would like to add the Google Analytics code.
  4. In the text box, enter your Google Analytics Account ID for the domain you are configuring. It will look something like UA-12345678-1. You will need to obtain this from your Google Analytics account.
    Configure Google Analytics for Your Domain Name
  5. Click Set Up Google Analytics.

Now, every time someone loads a page from the specified domain, the visit will be logged in Google Analytics. You will need to log into your Google Analytics account to see information about your visitors.

Troubleshooting

I do not see the option for Google Analytics Integration in my cPanel.

This feature is currently only enabled on our Shared hosting plans (Hatchling, Baby and Business).

I cannot publish using SiteBuilder after enabling the Google Analytics Plugin.

Because of the way the substitution engine works, if you are using the Google Analytics plugin in the HostGator control panel, you will not be able to publish your site in SiteBuilder.

To fix this, you will need to comment out the Google Analytics integration in the .htaccess file or disable it in cPanel, publish the website and then enable it again. For step-by-step instructions on how to resolve this issue, please see:


cPanelcPanel is a popular web hosting control panel that helps you manage your hosting account and assists you in creating web sites, managing e-mail addresses, & installing applications to a server.

cPanel is available on all HostGator Linux hosting plans, including Shared Hosting, Reseller Hosting, VPS and Linux Dedicated Servers.