Analytics Market Chart

Google Analytics Code Generator

Tracking Code Generator

This wizard will apply advanced customizations to your Google Analytics tracking code. It creates code for multiple domains and account numbers, cookie expiration, visit length, and local __utm.gif tracking requests for processing in Angelfish Software.

Does your company keep a backup of your Google Analytics data? If not, start today.


Important: This wizard only works with ga.js. You will need your Google Analytics profile numbers (eg. UA-1235-1) before starting this wizard!

We recommend using this code generator in conjunction with our LinkTagger script for automatically tagging external links, downloads and multiple domains.

More information about advanced customization of the Google Analytics code.

Domain Name(s)

List all the domain names your site uses. If your site uses multiple subdomains on the same root domain, just list the root domain without a subdomain specified. If your site uses multiple domains, please separate them by commas.

Some sites use multiple domain names for things like third-party landing pages or checkout processes. Only enter the domain names above if you have control of the code on the domain.

Visit Length

How long can a visitor be idle on your site before his visit should expire?

By default a visitor's visit ends either when he closes his browser or 30 minutes after his last interaction with the site.

Increasing the visit timeout value is sometimes useful for content sites where visitors tend to browse the site periodically throughout the day without ever closing the browser window.

On the other hand, reducing the timeout value might be useful if visitors start and conclude multiple short visits to your site in a day and you want to make sure they are recorded as separate visits.

Visitor Tracking

How long should a unique visitor be tracked?

By default, a unique visitor cookie is set for two years and refreshed with each visit. This allows you to see whether a visitor is new or returning even if it has been a long time since their last visit.

Changing this value to a shorter time period will mean that visitors who do not visit your site frequently will be counted not only as new visits, but also as new visitors.

Extending the time period will mean that visitors who do not visit your site for more than two years will still be seen as a returning visitor.

Campaign Timeouts

How long should a visitor's activities be attributed to a traffic source or campaign?

By default all of a visitor's activity is credited to the last campaign or traffic source they used to reach the site. This traffic source is overwritten only if the visitor comes back through some other method (except a direct visit) or six months after the initial visit from that source.

If it is common for visitors to come to your site through a marketing campaign and thereafter only directly, decreasing the campaign timeout value will prevent future activity from being accredited to the original advertisement long after the ad expired.

Increasing the timeout value will allow you to see longer term value of different traffic sources.

Angelfish or Google Analytics

Are you using Google Analytics, Angelfish Software or both?

If you are using Angelfish Software, you must have the __utm.gif file downloaded to the root of your website.

UA Number

What is the profile number that you want to track this site in? (eg. "UA-12345-1") Please include the preceding letters "UA" and all hyphens.

If you want to track this site in multiple profiles, enter each profile number in the box above, separated by commas.

If you don't have your UA number now you can always enter a fake number (like UA-12345-1) here and replace it with your actual profile number after creating the code.

Below is the code to place on your site(s). If your site uses multiple domains, different code for each domain has been generated. Instructions for implementing this code have been placed below.


  1. Copy and paste the code above into each page of your website just above the closing </head> tag. If you are using a template or CMS (eg. Drupal, Wordpress, etc.), paste this code into the top of the editable page.
    • Important! If you are going to send this code to a developer to implement, do not just copy and paste it into an email. Many email systems will try to reformat the code, and it won't work on your site. Instead, copy and paste it into a text document and attach that document to your email.
  2. If your site uses multiple domains or if you want to track downloads and outbound links, use our LinkTagger wizard to generate code that goes directly beneath this code on each page.
  3. If you have an e-commerce site, you will need a developer to insert the code onto only the receipt page. Some systems have built-in support for Google Analytics e-commerce tracking. Check with your developer or provider.