-
Type:
Feature Request
-
Status: Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: WCM > Analytics
-
Labels:None
If you want to add additional tracking criteria to Google Analytics on every page (e.g., _gaq.push(['_setCustomVar'...])), currently there are several ways to do this:
1) modify top_js.jspf and insert the additional criteria between _gaq.push(['_setAccount'...]) and _gaq.push(['_trackPageview'])
This creates support issues when Liferay is upgraded, because the file must be modified after each patch or upgrade
2) modify top_js-ext.jspf and insert _gag.push('_setCustomVar'...]), then _gaq.push(['_trackEvent'...])
This creates two requests to Google, which works, but is wasteful when _setCustomVar could be invoked as part of the initial _trackPageview request.
3) hijack the PIWIK analytics text field and add the Google Analytics _setCustomVar and _trackEvent there.
This still creates two requests to Google for the same page.
It would be helpful if in addition to a Google UA code, an administrator could specify additional Google Analytics code to execute prior to _trackPageview, in much the same way PIWIK analytics is allowed.