Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
ga_push currently uses the following mappings in ga_push_analyticsjs_measurement_protocol_map():
'location' => 'dh',
'page' => 'dp',
The Measurement Protocol docs state:
- dl: Document location URL (example: "http://foo.com/home?a=b")
- dh: Document Host Name (example: "foo.com")
- dp: Document Path (example: "/foo")
The Rules action ga_push_action_push_pageview() in turn uses:
'location' => $location,
'page' => $page,
The descriptions on mentioned rule edit form list:
- Location: URL of the page being tracked. By default, analytics.js sets this to the full document URL, excluding the fragment identifier.
- Page: A string that is uniquely paired with each category, and commonly used to define the type of user interaction for the web object.
There seem to be quite a lot of mixups here, so quite possibly this issue needs to get split up further. I think the most pressing issue for now is the mapping of location to host. Not sure if a "straight" fix is possible without breaking existing sites that might have worked around this problem.
Comment | File | Size | Author |
---|---|---|---|
#5 | location-2766311-5.interdiff.txt | 2.5 KB | Arla |
#5 | location-2766311-5.patch | 2.92 KB | Arla |
| |||
#4 | ga_push-2766311.patch | 2.07 KB | GeduR |
|
Comments
Comment #2
ciss CreditAttribution: ciss at yousign GmbH commentedComment #3
GeduR CreditAttribution: GeduR at Metadrop commentedAfter checking the documentation, it is a little tricky. For JS the parameter is "page" instead of "path": https://developers.google.com/analytics/devguides/collection/analyticsjs...
The location parameter is wrong, good catch!
Comment #4
GeduR CreditAttribution: GeduR at Metadrop commentedAttaching patch
Comment #5
ArlaWhy not add 'host' in there too.
Comment #6
ciss CreditAttribution: ciss at yousign GmbH commented@Arla Good point. Not having a replacement option for
dh
would be a bad idea.@GeduR What is your intended process for committing and releasing this patch? I imagine it will break a lot of people's setups in ways not immediately obvious.
Comment #7
ciss CreditAttribution: ciss at yousign GmbH commented@GeduR what is required to move this issue forward?