Initialize page tracking with the functions below.
| Function | Old Style | New Style |
|---|---|---|
| Account to track. Identifies the account number in which the page should be tracked. |
_uacct |
_gat._getTracker(urchinAccount) |
| Track the page. Sends the page tracking data to the Google servers. |
urchinTracker(); |
_trackPageView(opt_pageURL) |
Together, the Initialization and Page Tracking functions should look like the code shown below.
| Old Style | New Style |
|---|---|
| …
|
…
|
Control data collection settings |
Back to Top |
By default Google Analytics will track a set of data elements, such as Flash versions and web browser information. You have the option to turn this detection off by using the functions listed below, but remember – once you do so, you will lose the data permanently.
Control the amount of information you collect by using the functions listed below.
| Function | Old Style | New Style |
|---|---|---|
| Collect browser attributes. Sets the browser tracking module. Controls collection of browser attributes. You can also learn how to disable client tracking for certain pages. |
_ufsc |
_setClientInfo(enable) |
| Detect Flash version. Sets the Flash player version detection flag. |
_uflash |
_setDetectFlash(enable) |
| Detect the page title. Sets the title detection flag. Learn how to configure GA to ignore titles. |
_utitle |
_setDetectTitle(enable) |
Together, the control data collection settings functions should look like the code below.
| Old Style | New Style |
|---|---|
| …
|
…
|
Tracking Subdomains and Third-Party Sites |
Back to Top |
Track a visitor across a site or multiple sites using links or forms with the functions listed below.
| Function | Old Style | New Style |
|---|---|---|
| Share cookies with another domain via HREF or GET. Passes the cookies from visited site to another via query string parameters. |
__utmLinker(this.href); |
_link(targetUrl) |
| Share cookies with another domain via POST. Passes the cookies from visited site to another by adding 0query string parameters in a POST form request. |
__utmLinkPost(this); |
_linkByPost(formObject) |
| Enable linking to another domain. Sets the linker functionality flag. |
_ulink |
_setAllowLinker(true or false) |
| Determine the domain for the tracking cookies. Use when linking across subdomains or to other domain names. |
_udn |
_setDomainName(newDomainName) |
The table below shows what the code will look like when you track multiple sites using a link versus a form.
| Tracking method | Old Style | New Style |
|---|---|---|
| Using a link | …
|
…
|
| Using a form | …
|
…
|
E-Commerce Transaction Tracking |
Back to Top |
Track sales revenue and measure success with the funtions below.
| Function | Old Style | New Style |
|---|---|---|
| Add a new item to an e-commerce transaction. The data in each item line follows a pipe (|) separated list. |
UTM:I|order-id|product name|category|total|quantity |
_addItem(orderId, sku, productName, variation, unitPrice, quantity) |
| Add a new e-commerce transaction to track. The data in each transaction line follows a pipe (|) separated list. |
UTM:T|order-id|affiliation|total|tax|shipping|city|state|country |
_addTrans(orderId, store, total, tax, shippingFee, billingCity, billingState, billingCountry) |
| Send transaction and item data to Google. Use after all the items are added to the transaction. |
__utmSetTrans(); |
_trackTrans() |
Use the code below on your receipt page to track your e-commerce transactions.
| Old Style | New Style |
|---|---|
| …
|
…
|
Campaign Tracking |
Back to Top |
Configure your Google Analytics to track your campaigns using the functions shown below.
| Function | Old Style | New Style |
|---|---|---|
| Set campaign tracking flag. Activates campaign tracking module. |
_uctm |
_setCampaignTrack(enable) |
| Set campaign content key. Parses campaign content from URL. Use this information to create A/B tests with our free Website Optimizer tool. |
_ucct |
_setCampContentKey(newCampContentKey) |
| Set the campaign ID key. Use to parse campaign ID from URL. |
_ucid |
_setCampIdKey(newCampIdKey) |
| Set the campaign medium key. Use to parse campaign medium from URL. |
_ucmd |
_setCampMediumKey(newCampMedKey) |
| Set the campaign name key. Use to parse campaign name from URL. |
_uccn |
_setCampNameKey(newCampNameKey) |
| Set the campaign no-override key. Use to parse campaign no-override value from URL. |
_ucno |
_setCampNOKey(newCampNOKey) |
| Set the campaign source key. Use to parse campaign source from URL. |
_ucsr |
_setCampSourceKey(newCampSrcKey) |
| Set the campaign term/keyword key. Use to parse campaign term or keyword from URL. Should be used to track paid search advertising. |
_uctr |
_setCampTermKey(newCampTermKey) |
| Set allow anchor usage flag for campaigns. When enabled, uses # instead of the default ? to separate the request stem from the query string. |
_uanchor |
_setAllowAnchor(enable) |
Try tracking campaigns with custom field names. Pass these names to the campaign functions on your landing pages so that Google Analytics can recognize your campaign information from your manually tagged URLs.
| Old Style | New Style |
|---|---|
| …
|
…
|
Customizations: Sources |
Back to Top |
Set keyword or referrer ignore preferences, or add new organic search engines to track.
| Function | Old Style | New Style |
|---|---|---|
| Add new ignored organic keyword. List of keywords to ignore. Learn how you can treat certain referral sources as direct traffic. |
_uOno[] |
_addIgnoredOrganic(newIgnoredOrganicKeyword) |
| Add new ignored referrer. List of referral domains to ignore. |
_uRno[] |
_addIgnoredRef(newIgnoredReferrer) |
| Add new organic search engine to track. List of organic search engines to match automatically in referrals. |
_uOsr[] |
_addOrganic(searchEngine, queryVariable) |
Look at the code below to see how you can configure Google Analytics to set ignore preferences and add organic search engines.
| Old Style | New Style |
|---|---|
| …
urchinTracker(); |
…<script type="text/javascript">;
</script> |
Customizations: Cookies |
Back to Top |
Reset and control your cookies so they serve your unique business needs.
| Function | Old Style | New Style |
|---|---|---|
| Set flag to allow domain hash. Create a unique domain hash (or numerical representation) of the domain name, which is then put into cookies. Look at controlling data collection settings to see how this is supposed to be implemented into the code. |
_uhash |
_setAllowHash(true or false) |
| Set new default cookie path. Controls the path in the request used to determine what cookies are (re)set and delivers to the requesting site. By default, Google Analytics sets the cookie path to /. If you would like to change this, send your preferred cookie path to the _setCookiePath function. |
_utcp
… |
_setCookiePath(newCookiePath)
…. |
| Set new default cookie expiration time. Set the campaign tracking cookie timeout in seconds. Google Analytics credits the most recent campaign if conversion happens within six months, but you customize the timeout by sending the desired number of seconds to the _setCookieTimeout function. |
_ucto
… |
_setCookieTimeout(newDefaultTimeout)
… |
| Set the new session timeout in seconds. The standard session timeout is 30 minutes, but you can customize it to what works for your business. Please use this function carefully since this very important setting is used to compute visits. |
_utimeout
… |
_setSessionTimeout(newTimeout)
… |
| Set user defined value. Set the visitor segmentation cookie to help classify the types of visitors coming to your site. For example: new customer vs. prospect, or cat owner vs. dog owner. |
__utmSetVar(newVal);
… |
_setVar(newVal)
… |
| Get the session ID. Return the session ID from the __utma cookie. |
__utmVisitorCode(); |
_visitCode() |
Customizations: Using a Local Server |
Back to Top |
| Function | Old Style | New Style |
|---|---|---|
| Set the new local GIF path. Set the file system path to the __utm.gif file. |
_ugifpath |
_setLocalGifPath(newLocalGifPath) |
| Set operation in both local and remote server mode. Sends data to both Google Analytics backend server and local server. Local server path is determined by _setLocalGifPath() value. Please note that you can track Google Analytis and Urchin software by calling this function in the tracking code. |
_userv = 2;
… |
_setLocalRemoteServerMode()
… |
| Set operation in local server mode. Sends data to a local server. Path to local server is determined by _setLocalGifPath() value. |
_userv = 0; |
_setLocalServerMode() |
| Set operation in remote server mode. Sends data to Google Analytics backend server. |
_userv = 1; |
_setRemoteServerMode() |
https://www.google.com/analytics/settings/check_status_profile_handler?id=1968019
SnowTweet
Xe Dap Oi !