The attached patch adds a new field in the advanced settings section of the GA configuration form to enter JavaScript to be used as a value for the URL in _trackPageview().
As mentioned in the help text underneath that field, this value will be overridden on certain pages if you use the "Track internal search" and "Track translation sets as one unit" options.
Documentation for using this optional custom url is at http://code.google.com/apis/analytics/docs/gaJS/gaJSApiBasicConfiguratio...
Some discussion of why people use this feature is at
http://stackoverflow.com/questions/4811172/is-it-possible-to-track-hash-...
https://groups.google.com/a/googleproductforums.com/forum/#!category-top...
https://groups.google.com/a/googleproductforums.com/forum/#!category-top...
| Comment | File | Size | Author |
|---|---|---|---|
| custom-pathname-for-google-analytics-module.patch | 2.67 KB | tom_o_t |
Comments
Comment #1
hass commentedSound like a duplicate #231451: Add hook to alter data before sending it to browser
Comment #2
loze commentedThank you for this patch.
+1 For making this a setting, since there seems to be a debate if a hook should be added or not on the duplicate issue.
The patch a small change that adds a great deal of flexibility when defining the page url passed to GA.
In my case, I added a js function that returns the path (determined by some custom business logic) I wanted tracked, and called this function in the settings field this patch provides. It seems to be working for me.
Thanks.
Comment #3
remkovdz commentedI'd also like to see this incorporated in the module.