Last Updated: 14 Oct 2023
|
Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
marketing-tech:google-analytics:power-user-tips-and-tricks [Nov 14, 2012 09:51 AM] dordal |
marketing-tech:google-analytics:power-user-tips-and-tricks [Oct 14, 2023 04:42 AM] dordal old revision restored (Nov 21, 2020 10:39 PM) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | = Google Analytics Power User Tips = | ||
+ | [[http:// | ||
+ | |||
+ | == Basic Install == | ||
+ | |||
+ | Basic Install is pretty well covered by [[http:// | ||
+ | |||
+ | Once you get that done, login and start looking at your reports. Note that (annoyingly) any configuration changes you make to your reports (e.g. apply a new filter, change your default homepage filename, etc.) only affect data from that day onward. You can't go back and reprocess old data. | ||
+ | |||
+ | === Tracking Terminology === | ||
+ | |||
+ | Google Analytics has five tracking areas in the Standard Reporting section: // | ||
+ | |||
+ | In most reports, Google Analytics tracks pretty much everything via **Visits**, which is one person being active on the site. They can be active as long as they want, but as soon as they are [[http:// | ||
+ | |||
+ | **Pageviews** counts the number of individual pages that has been viewed; a reload of a page means that page is counted again. **Unique Pageviews** filters out reloads (so if you reload a page ten times, that's ten pageviews but one unique pageview). Unique Pageviews only count across visits, meaning if someone views a page, waits 30 minutes (and thus their ' | ||
+ | |||
+ | === Tracking Goals ==== | ||
+ | |||
+ | Each GA profile gives you up to four **Goal Sets** that you can track, each of which can contain up to five **Goals**. You don't have to insert any special code into your pages for these; GA matches your goals based on the URL of the page. In my opinion, the best thing to do is to write regular expression matches against the URL; this allows you a lot of flexibility you wouldn' | ||
+ | |||
+ | For example, [[http:// | ||
+ | |||
+ | In 2011, Google added Event Goals, which allow you to track goals based on Event actions rather than just pageviews. | ||
+ | |||
+ | === Filters === | ||
+ | |||
+ | Filters are one of the most powerful features of GA. They let you include or exclude certain pages/ | ||
+ | |||
+ | The most important (and most annoying) thing about filters is that they run when the original data is collected, and **ONLY** when the original data is collected. If you make a mistake, or you just want to go retroactively apply a new filter to your data, you can't. | ||
+ | |||
+ | == Power User Tips == | ||
+ | |||
+ | ==== Debugging with ga_debug.js ==== | ||
+ | |||
+ | Google recently [[https:// | ||
+ | |||
+ | ==== Excluding Query Parameters ==== | ||
+ | |||
+ | You can exclude certain query parameters in your URLs from being counted as separate pageviews. For example, one vendor I've worked with routinely sends traffic that looks like this: | ||
+ | |||
+ | < | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | However, every time they send // | ||
+ | |||
+ | < | ||
+ | tqnm, | ||
+ | </ | ||
+ | |||
+ | to the ' | ||
+ | |||
+ | ==== Using Campaign Tracking Variables ==== | ||
+ | |||
+ | You can track your inbound sources of traffic with '' | ||
+ | |||
+ | ==== Using Filters instead of Default Page === | ||
+ | |||
+ | GA lets you set a ' | ||
+ | |||
+ | A better solution is to setup a filter, which renames '' | ||
+ | |||
+ | === Tracking Email via Google Analytics === | ||
+ | |||
+ | You can use the GA campaign feature to [[Campaigns and Email Tracking|track marketing campaigns]], | ||
+ | |||
+ | === Google Records Cached Hits === | ||
+ | |||
+ | If a user loads your page out of the Google Search cache, your Google Analytics code **WILL** run, and you'll record a hit for that page. Generally, this is probably OK... I think a cached hit is still a ' | ||
+ | |||
+ | === Using _setVar() to track Logged In Users === | ||
+ | |||
+ | **Update 1 Nov 2012:** This method of tracking users is deprecated; [[https:// | ||
+ | |||
+ | GA has a 'user defined' | ||
+ | <code php> | ||
+ | // any user with $isLoggedIn set to true will have the user defined GA variable | ||
+ | // set to ' | ||
+ | pageTracker._setVar(<? | ||
+ | pageTracker._trackPageview(); | ||
+ | </ | ||
+ | There are a few things to keep in mind: | ||
+ | * There is **only one** user defined variable. If you call '' | ||
+ | * The variable is stored in the cookie, and thus is passed on subsequent GA pageviews. This can be good (you don't have to set it again) or bad (the status of the variable changes and you forget to update it). Just keep it in mind. | ||
+ | * It should also be noted this variable is passed across entire //visits//. So if you set a visitor to ' | ||
+ | * **NOTE:** If you use '' | ||
+ | |||
+ | === Tracking Named Pageviews & Events === | ||
+ | |||
+ | If you want, you can inject a pageview into the Google Analytics stats. This is done by calling '' | ||
+ | <code javascript> | ||
+ | _gaq.push([' | ||
+ | </ | ||
+ | Needless to say, the main google code should have loaded before you try to call this function, but if you're putting it in an '' | ||
+ | |||
+ | Google Analytics can also track events. An event is some sort of in-page action, such as clicking on a popup. An event has several properties, and you call it like this: | ||
+ | |||
+ | <code javascript> | ||
+ | _trackEvent(category, | ||
+ | </ | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | If you're using event tracking, I suggest that you wrap your tracking code in an if statement to check if an event has been tracked already. For example: | ||
+ | |||
+ | <code language=javascript> | ||
+ | var trackShareSubmit = false; | ||
+ | $('# | ||
+ | if (!trackShareSubmit) { | ||
+ | _gaq.push([' | ||
+ | trackShareSubmit = true; | ||
+ | } | ||
+ | }); | ||
+ | </ | ||
+ | |||
+ | Why do this? For most applications, | ||
+ | |||
+ | Lastly, notice how I used '' | ||
+ | |||
+ | === Social Event Tracking === | ||
+ | |||
+ | Finally, you can [[https:// | ||
+ | |||
+ | //In contrast to the doc above//, I recommend you only track ' | ||
+ | |||
+ | Both [[http:// | ||
+ | |||
+ | === Google Analytics Validation Doesn' | ||
+ | |||
+ | GA doesn' | ||
+ | |||
+ | === Tracking Subdomains === | ||
+ | |||
+ | There are numerous ways to track sub-domains in Google Analytics, but I think [[http:// | ||
+ | |||
+ | === Set the campaign cookie timeout using setCookieTimeout() === | ||
+ | |||
+ | You may want to set the campaign cookie timeout to something short (such as seven days) rather than the standard six months. For more, see the article on [[old-campaign-data-appearing-in-new-reports|old campaign data appearing in new reports]]. | ||
+ | |||
+ | === Google Analytics API === | ||
+ | |||
+ | The full GA API [[http:// |