Problem/Motivation
Universal Analytics has stopped supporting Custom Variables in favor of Custom Dimensions and Metrics:
https://developers.google.com/analytics/devguides/collection/analyticsjs...
Proposed resolution
The 2.x branch must convert the current Custom Variables interface and integration code to match the new API.
I don't think there's a clean update path from ga.js to analytics.js, though. Not only do Dimensions and Metrics need to be pre-configured within Google's management interface, which may cause slots to change, but there's also no way to programmatically decide whether a particular Custom Variable should be converted to a Dimension or a Metric.
Remaining tasks
#231451: Add hook to alter data before sending it to browser
User interface changes
None
API changes
Hm... yes.
Comment | File | Size | Author |
---|---|---|---|
#15 | Issue-2136031-Implement-custom-dimensions-and-metric.patch | 28.9 KB | hass |
Comments
Comment #1
Les LimThe following patch updates both the admin interface and the integration code in hook_page_alter().
Comment #2
hass CreditAttribution: hass commentedThanks a lot for sharing this patch. It looks like we need to support up to 200 dimensions. :-(
I thought about adding a local tab to the admin ui and add an interface like manage fields to allow these high number...
Comment #3
hass CreditAttribution: hass commentedThis is blocked by #231451: Add hook to alter data before sending it to browser and requires a rerole for this one.
Comment #4
bmarshall CreditAttribution: bmarshall commentedJust wanted to check to see if there was an ETA to get custom dimensions & metrics implemented? Working on a project that's been usually this module for a while now, but needs dimensions support ASAP in order to get the reporting they need.
Comment #5
hass CreditAttribution: hass commentedMay I ask if you are able to sponsor the coding?
Comment #6
bmarshall CreditAttribution: bmarshall commentedWould love to, but I'm fairly new to Drupal and not naive enough to call myself a Drupal developer yet.
In order to get it working for the needs of the project I'm on, it appears the patch in #1 works. All I had to do was uncomment the code that adds the custom dimensions/metrics script in googleanalytics.module on line 314. Viewed the source and tested with the GA debugger extension and all looks good.
Other than that, the only thing left I think would be to allow for 200 dimensions. Don't think there's a need to create a script to move the old custom variables into dimensions due to having to first set them up in GA.
Comment #7
hass CreditAttribution: hass commentedYou can donate.
Comment #8
boldart CreditAttribution: boldart commented@hass - I am also interested in getting Custom Dimensions completed and am interested in donating towards that end. What would help and how would I go about it?
Comment #9
hass CreditAttribution: hass commentedI'm not blocking this on the other case any longer.
Comment #10
wiifmAttached is a patch that simply enables the output of the custom dimensions and metrics (as for some reason this was commented out). Everything else is the same.
Can confirm it works as expected, and that tokens are being replaced.
Not too sure about having 20 dimensions in the admin UI (I am using only 2), might be nicer as a follow up issue to use AJAX to add another row to the form (ala adding choices to polls).
Comment #11
hass CreditAttribution: hass commentedComment #12
hass CreditAttribution: hass commentedComment #13
hass CreditAttribution: hass commenteda
Comment #15
hass CreditAttribution: hass commentedComment #18
hass CreditAttribution: hass commented