Upload
jerry-wijaya
View
1.385
Download
0
Embed Size (px)
Citation preview
Google Analytics
Joris Roebben ([email protected])Tom Michiels ([email protected])
www.queromedia.com
Google Analytics advantages
• Free• Sufficiant possibilities for most
companies• Easy to implement• Easy to use• Easy to understand
Google Analytics disadvantages
• URL and title based• No data history• Privacy ?• JavaScript and cookies• Only visitors, no crawlers or bots
Best practice for GA accounts
• Create GA account on [email protected]
• Add [email protected] as administrator
• Add [email protected] as reviewer
• Advantage: structure
urchin.js
• Old code• Can still be used
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script><script type="text/javascript">_uacct = "UA-123456-1";urchinTracker();</script></body></html>
GA.js
• New code• New features not yet available
<script type="text/javascript">var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");document.write("\<script src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'>\<\/script>" );</script><script type="text/javascript">var pageTracker = _gat._getTracker("UA-123456-1");pageTracker._initData();pageTracker._trackPaginaweergave();</script></body></html>
Host your own GATC
• Possible• Not advised
<script src="http://www.mydomain.com/mytrackingcode.js" type="text/javascript"></script><script type="text/javascript">_uacct = "UA-123456-1";urchinTracker();</script>
Check your installation
• Put code just before </body>• Loads pages faster• No problem if GA offline
Easy implementation
• All HTML-files: lot of work• Dynamic site: look for footer
inclusion• CMS: look for templates
• Put GATC on ALL pages !!!• Correct data = essential
Access manager
• Give access to GA account• Must be Google account• Administrator or View Reports only
Step 2: Login to Google AdWords
• www.google.com/adwords as Administrator
5. Profiles and Filters
• Are the real strength of GA• Segment data• Deep analysis• Depending on needs• Start collecting data when created
Data needed for profile
• Website URL• Profile Name• Time Zone• Default Page• Exclude parameters• E-commerce
website• Search
GATC for different profiles
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script><script type="text/javascript">_uacct = "UA-123456-1";urchinTracker();</script>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script><script type="text/javascript">_uacct = "UA-123456-2";urchinTracker();</script>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script><script type="text/javascript">_uacct = "UA-654321-1";urchinTracker();</script>
Filters
• Applied to profile• Change data (forever!)• Segmentation• Business rules• 2 sorts: predefined and
custom• Test profile
How do filters work?
3 components• Filter Type• Filter Fields• Filter PatternFilter data before
submitting it to GA DB
Multiple filters
• No problem• Multiple filters applied to data• Data output filter 1 is input filter 2• Be careful !!!• Wrong conclusions
Filterfields
• 37 fields• Field = pageview attribute• Regular fields and user defined fields• Regular: request URI, hostname, referral,
page title, browser, IP address,...• User defined: campaign name, source,
campaign term, e-commerce variables,...
Filter Patterns
• Pattern is applied to filterfield• If ok, data registered• If not ok, data neglected• Build patterns using RegEx• RegEx = set of characters,
representative for bigger set of data
5.7 Lookup table filter
• Not available in GA• Only old Urchin customers• ~Search and replace filter• Text file
5.8 Advanced filters
• Change data fields• By combining elements• 2 filter fields: Field A and Field B• Extract field = Constructor• RegEx !!!
6. Custom segmentation
• Segment data• _utmv cookie• JavaScript function _utmSetVar()• On pages tagged with GATC• Applied to HTML attributes as
onLoad(), onChange(), onSubmit()• Only 1 cookie per visitor (website)
Custom segmentation code
• Everyone = visitor (“not set”)• When registered = member• When completed buy = customer• Report: Visitors > User defined
<body onLoad=”javascript:_utmSetVar(‘member’);”>
<body onLoad=”javascript:_utmSetVar(‘customer’);”>
RegEx
Regular expressions are used to match or capture portions of a field using wildcards and metacharacters. They are often used for text manipulation tasks.
Most of the filters included in Google Analytics use these expressions to match the data and perform an action when a match is achieved. For instance, an exclude
filter is designed to exclude the hit if the regular expression in the filter matches the data contained in the field specified by the filter.
Regular expressions are text strings that contain characters, numbers, and wildcards. Note that these wildcard characters can be used literally by escaping
them with a backslash '\'. For example, when entering www.google.com, escape the periods with a backslash: www\.google\.com
RegEx
. match any single character* match zero or more of the previous items+ match one or more of the previous items? match zero or one of the previous items() remember contents of parenthesis as item[] match one item in this list- create a range in a list| or^ match to the beginning of the field$ match to the end of the field\ escape any of the above
More: http://en.wikipedia.org/wiki/Regex
7. Goals
• Conversions ?• Conversion rate• Reports• Success of site• “Thank you” page• Max. 4 per profile• Contact – buy – download - register
Goals howto
• Match type• Goal value• Choose good name• Unique “thank you” page per conversion• Keep track of filters
Implementing E-commerce tracking
• Activate E-commerce tracking in profile
• Add code below GATC• Extra reports• Data from transaction needs to be
transfered to GA• 1 Transaction• Multiple items• urchin.js vs. GA.js
E-commerce for urchin.js
<form style="display:none;" name="utmform"><textarea id="utmtrans">UTM:T|[order-id]|[affiliation]|[total]|[tax]|[shipping]|[city]|[state]|[country]UTM:I|[order-id]|[sku/code]|[productname]|[category]|[price]|[quantity]UTM:I|[order-id]|[sku/code]|[productname]|[category]|[price]|[quantity]</textarea></form>
E-commerce for GA.js<script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script><script type="text/javascript"> var pageTracker = _gat._getTracker("UA-XXXXX-1"); pageTracker._initData(); pageTracker._addTrans( "1234", // Order ID "partner", // Affiliation "2500.25", // Total "200.25", // Tax "3", // Shipping "Brussels", // City "Brabant", // State "Belgium" // Country ); pageTracker._addItem( "1234", // Order ID "MTB25", // SKU "Mountainbike", // Product Name "Off-road", // Category "1500", // Price "1" // Quantity ); pageTracker._addItem( "1234", // Order ID "MTB44", // SKU "Mountainbike", // Product Name "Cross", // Category "1000.25", // Price "1" // Quantity ); pageTracker._trackTrans();</script>
Tips & Tricks: Event tracking
• Downloads, clicks, ...• Urchintracker() generates pageview• Pageviews in reports• Naming !
<a href="http://www.webiste.com/pdf/document1.pdf" onClick="javascript:urchinTracker('/pdf/document1');">
Tips & Tricks: Multi-domain tracking
• Website on multiple domains• Most often used for external checkout• Transfer content of first party cookies
to other domain• urchin.js vs. GA.js
Multi-domain tracking urchin.js (1)
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct="UA-xxxx-x"; _udn="none"; _ulink=1; urchinTracker(); </script>
• Change GATC
Multi-domain tracking urchin.js (2)
• Change cross-domain links<a href="https://www.secondsite.com/?login=parameters">Log in Now</a>
<script type="text/javascript"> document.write('<a href="javascript:__utmLinker(\' https://www.secondsite.com/?login=parameters\');">Log in Now</a>'); </script> <noscript> <a href=" https://www.secondsite.com/?login=parameters ">Log in Now</a> </noscript>
Multi-domain tracking GA.js (1)
• Change GATC
<script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? " https://ssl." : "http://www."); document.write("\<script src='" + gaJsHost + "google-analytics.com/ga.js ' type='text/javascript'>\<\/script>" ); </script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-12345-1"); pageTracker._setDomainName("none"); pageTracker._setAllowLinker(true); pageTracker._initData(); pageTracker._trackPaginaweergave(); </script>
Multi-domain tracking GA.js (2)
• Change cross-domain links<a href="https://www.secondsite.com/?login=parameters">Log in Now</a>
<script type="text/javascript"> document.write(‘<a href="javascript:pageTracker._link(\'https://www.secondsite.com/?login=parameters\');">Log in Now</a>'' );</script><noscript> <a href="https://www.secondsite.com/?login=parameters">Log in Now</a> </noscript>
Tips & Tricks: Tracking outbound links
• Creating pageviews• Using UrchinTracker()• Pageviews in reports• Naming !
<a href="http://www.otherdomain.com" onClick="javascript:urchinTracker('/outbound/otherdomain');">
Tips & Tricks: Tagging inbound links
http://www.website.com/pagina.html
http://www.website.com/pagina.html?utm_source=partner&utm_medium=banner&utm_campaign=nl&utm_term=zoekwoord
• Adjust cookies• ~Google AdWords auto-tagging• Not all parameters are required
11. Roundup
1. Create a Google Analytics account.2. Analyze the website.3. Create and Configure profiles.
a) Create filters.b) Create goals and funnels.c) Create recommended profiles.
4. Edit the tracking code.5. Modify the web site.6. Add the tracking code to web site pages.7. Tag marketing campaigns.8. Enable e-commerce transaction tracking.9. Implement custom segmentation.10. Configure other administrative features.
a) User accounts and report access.b) Automated email report delivery.