[DOCU-154] Document Google Analytics for STK Module Created: 16/May/11  Updated: 12/Oct/15  Resolved: 11/Jun/12

Status: Closed
Project: Documentation
Component/s: content
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Neutral
Reporter: Boris Kraft Assignee: Antti Hietala
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Zip Archive GA-Printscreens.zip     PNG File button-paths.png     PNG File get-tracking-code.png     PNG File highlighting-a-single-node.png    
Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Date of First Response:

 Description   

Can't find any docs on the Google Analytics Integration module. Please provide one! Even the store description is absolutely minimalistic.



 Comments   
Comment by Antti Hietala [ 17/May/11 ]

Things to cover:

  • Module implementation is based on the gaTracker jQuery plugin.
  • jQuery script is in Templating Kit > Resources > /templating-kit/js/all/jquery-gatracker.
  • Read the comments in the script and visit Jason Huck's and David Simpson's blogs to learn more.
  • demo.magnolia-cms.com is being tracked. Look at the reports, particularly Content Overview.
  • Module Javadoc is not published. Search for magnolia-module-google-analytics in Nexus and download the javadoc.jar. Change extension to .zip and read locally.
  • Configuration happens in /modules/google-analytics/config. Describe:
    • Multi-site tracking. Extending works the same way as site definitions.
    • Inserting a tracker ID.
    • Enabling Google Analytics.
    • Tracking events. See EventsTrackingPattern in Javadoc and explain how the cssSelector pattern matching works. Explain that you can track very detailed in-page events such as stage paging and teaser switching. Benefits? View the Content Overview report in Google Analytics website. Search for the statsLink strings to filter results to particular events.
    • Tracking links
    • Domain, cross-domain tracking. Investigate/ask Christian.
    • Organic search. See OrganicSearchTrackingPattern in Javadoc and Analytics API
    • sampleRate
Comment by Ruth Stocks [ 31/May/11 ]

New page at http://docuauthor.magnolia-cms.com/modules/google-analytics.html

Comment by Antti Hietala [ 07/Jun/11 ]

Reviewed draft. Ruth, this is good work.

Introduction

  • Typo: "No additionally coding is needed."

Installing

  • Split the long sentence starting with "It is not included in the Community Edition" into two sentences.

Configuration

  • You don't need to look through the script to find the tracking code. Log into your Google Analytics account and copy the code from the Website Profiles page. See get-tracking-code.png attached.
  • Move the "Multiple domains" section from the end to here. Configuring sites should be the first task after enabling tracking. The names of the sites in GA config MUST match the names of sites in Site Definitions. This is how the configuration is mapped to actual site content. You need to explain this because it is not obvious. In a fresh install only default is configured as a GA site whereas on demoauthor demo-project, demo-features and demo-project-de are configured, which illustrates the name matching much better. A user who installs the module on their own system unfortunately won't see the demoauthor examples.
  • Rename the "Multiple domains" section to "Mapping GA config to sites" or something like that. GA module does not provide the multi-domain feature, ETK does. GA just maps to existing site configuration.
  • The extends examples are good. Keep them but explain that this is the default extends mechanism that works all over Magnolia, not specific to GA.
  • There's no need to use the arrow in the screenshot. Select the node you are talking about. See highlighting-a-single-node.png example attached. The default blue background is clear enough to highlight the focal point. Use the annotation shapes sparingly, such as when you don't have a "Magnolia way" to emphasize. Use in places where there is lots of noise and it is difficult for reader to know what they should be looking at.

Java scripts

  • Spelling: JavaScript. One word, camel case.
  • Explain what the scripts do:
    • jquery-tracker is the original gaTracker jQuery plug-in script with some Magnolia CMS customizations. It is a non-processed, normal JavaScript.
    • Model business logic translates the Magnolia configuration to a JavaBean using Content2Bean mechanism. init-gatracker is a processed JavaScript that then asks the model for the tracking configuration and injects the values into the gaTracker config.
  • Don't change the order of the nodes in the JavaScript tree. /js/all is a processed script that merges its subnodes. The order is significant. In many places you can move nodes to make a better screenshot but not here and not in filters.
  • Move the sentence about the original gaTracker jQuery plug-in to intro.

Tracking options

  • Make link tracking the first subsection. It is the most common option. Alphabetical order is not the most intuitive here.
  • Replace "User activity is displayed as events-tracking in the GA interface." with "The accessed page element is identified in the Content Performance report with a path that starts with /events-tracking."
  • Use normal, variable-width text when talking about the concept as opposed to a named node. "Within these categories of events, any number of patterns can be configured."
  • Plural: "The nodes configured under... allows for"
  • In property tables, place Description column to the left of Default value.
  • Replace "The pattern defined by the statsLink property determines the depth of the statistics that you will find in the GA reports." with "The pattern set in the statsLink property is the page path you see in the GA reports."
  • Pull apart the example statsLink value and explain its parts. The first part '/events-tracking/click/teaser-wrapper/tw-paging/stage/button- translates to '/events-tracking/click/teaser-wrapper/tw-paging/stage/button-. This is the fixed part of the "path" the user sees in the report. It is not a true path or page location but it makes easier for the user understand what is being tracked:
    • '/events-tracking - We are tracking an event
    • /click - it's a click event
    • /teaser-wrapper - in a teaser element
    • /tw-paging - it's a teaser that is navigated with paging buttons
    • /stage - that resides in the stage area of the page, so at the top of the home page typically
    • /button- and we are interested in which paging button is clicked.
  • Then explain the dynamic jQuery part. '+$(this).text().replace(/
    s/g, "-"
    translates to 1, 2, 3, 4 and so on. The jQuery queries the anchor element's content $(this).text() to get the button number, then uses a regular expression to replace any spaces in it with hyphens if any occur. As a result you get quite readable "paths", see button-paths.png attached.
  • Check your escapes in the statsLink pattern. Path doesn't look correct on the page.
  • Content Drilldown report is useful but you should recommend the full Content Performance report instead. In the full report the user can see the full "path" to the element and can filter results. Starting from the Overview page, you get to the report like this:
    1. Select your account.
    2. Click View Report for a site you want to analyze.
    3. Click Content in the left navigation menu.
    4. Click view full report at the bottom of the page.
    5. Type for example /events-tracking/click in the Filter Page box and click Go.
  • Keep your drilldown example as a secondary option.

Link tracking

  • Replace "...these links are not tracked automatically." with "these links are not tracked automatically by the gaTracker jQuery plug-in but they are tracked by the Google Analytics module".
  • linkPrefixToAdd property has an extra space in the table
  • Typo: "Each extension in registered in"
  • For extensions, the default value of the enabled property is true.

Miscellaneous tracking

  • Screenshot doesn't require arrow. Select node if you think there's too much noise. Go through all screenshots with the same consideration.

Multiple domains

  • Using a different account is a very good example.

I have also attached screenshots that Christian Ringele provided. You can use as such or take equivalent.

Comment by Ruth Stocks [ 10/Jun/11 ]

Thanks Antti

Updated page at - http://docuauthor.magnolia-cms.com/modules/google-analytics.html

A couple of points:

Link tracking

You asked me to amend the introductory sentence to:

"The Google Analytics module uses virtual pageviews to track download, external, mailto and anchor links. As they do not lead to a page of the site that contains the GA tracking code, these links are not tracked automatically by the gaTracker jQuery plug-in, but they are tracked by the Google Analytics module."

My understanding is that the original plugin does cater for link tagging and it is GA that does not automatically track links because they do not lead to a page of the site that contains the GA tracking code. This explanation seems valid for all links except anchors that do lead to a page on the site. I have left it simply at:
"The Google Analytics module uses virtual pageviews to track download, external, mailto and anchor links. GA does not track links by default unless they are specifically tagged, and the Google Analytics module takes care of this."

Event tracking

The pattern used in the example and screenshot has a double backslash before "s/g". The content in the edit dialog is correct, but it is not rendered. docuauthor replaces the double backslash with a line break. I have changed the screenshot to include the full pattern and deleted the pattern from the body text, but don't know how to get it to render correctly in the last row of the second table.

Comment by Antti Hietala [ 11/Jun/12 ]

Re: Event Tracking. Replaced backslashes with HTML character entities.

Generated at Mon Feb 12 01:06:26 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.