Fb:google-analytics
From Facebook Developers Wiki
Contents |
[edit] Description
Inserts appropriate Google Analytics code into a canvas page.
[edit] Attributes
| Required | Name | Type | Description | |
| required | uacct | string | Your Urchin/Google Analytics account ID. | |
|---|---|---|---|---|
| optional | page | string | The argument given to the urchinTracker() function, either a page or a virtual page. | |
| ufsc | bool | Sets client info flag, where 1=on and 0=off. This is a UTM user setting. (default value is 1) | ||
| udn | string | Sets the domain name for cookies. Specify auto, none or domain. This is a UTM user setting. (default value is auto) | ||
| uhash | string | Specify whether the unique domain hash for cookies is on or off. This is a UTM user setting. (default value is on) | ||
| utimeout | int | Sets the inactive session timeout in seconds. This is a UTM user setting. (default value is 1800) | ||
| ugifpath | string | Set the Web path to the __utm.gif file. This is a UTM user setting. (default value is /__utm.gif) | ||
| utsp | string | The transaction field separator. This is a UTM user setting. (default value is | (a pipe character)) | ||
| uflash | bool | Sets the Flash version detection option, where 1=on and 0=off. This is a UTM user setting. (default value is 1) | ||
| utitle | bool | Sets the document title detection option, where 1=on and 0=off. This is a UTM user setting. (default value is 1) | ||
| ulink | bool | Enables linker functionality, where 1=on and 0=off. This is a UTM user setting. (default value is 0) | ||
| uanchor | bool | Indicates whether the use of anchors for campaigns is enabled, where 1=enabled and 0=disabled. This is a UTM user setting. (default value is 0) | ||
| utcp | string | Specifies the cookie path for tracking. This is a UTM user setting. (default value is /) | ||
| usample | int | Represents the sampling percentage of visitors to track, which is a whole number from 1 to 100. This is a UTM user setting. (default value is 100) | ||
| uctm | bool | Sets the campaign tracking module state, where 1=on and 0=off. This is a UTM campaign tracking setting. (default value is 1) | ||
| ucto | int | Sets the timeout in seconds. This is a UTM campaign tracking setting. (default value is 15768000, or 6 months) | ||
| uccn | string | The name of the campaign. This is a UTM campaign tracking setting. (default value is utm_campaign) | ||
| ucmd | string | Represents the campaign medium. Specify cpc, cpm, link, email or organic. This is a UTM campaign tracking setting. (default value is utm_medium) | ||
| ucsr | string | Represents the campaign source. This is a UTM campaign tracking setting. (default value is utm_source) | ||
| uctr | string | The campaign term or keyword. This is a UTM campaign tracking setting. (default value is utm_term) | ||
| ucct | string | Represents the campaign content. This is a UTM campaign tracking setting. (default value is utm_content) | ||
| ucid | int | Represents the campaign ID number. This is a UTM campaign tracking setting. (default value is utm_id) | ||
| ucno | string | Indicates whether or not to override the campaign. This is a UTM campaign tracking setting. (default value is utm_nooverride) |
[edit] Notes
- This tag can only be used on canvas pages.
- The urchinTracker function provided by Google Analytics can be accessed in FBJS through Facebook.urchinTracker. To enable, include something similar to the following:
- <a href="http://www.example.com" onclick="Facebook.urchinTracker('/outgoing/example.com')">
[edit] Example
Inserting
<fb:google-analytics uacct="UA-9999999-99" />
Yields:
<script src="https://ssl.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-9999999-99"; urchinTracker(); </script>
