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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ciss created an issue. See original summary.

ciss’s picture

Issue summary: View changes
GeduR’s picture

After 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!

GeduR’s picture

Status: Active » Needs review
FileSize
2.07 KB

Attaching patch

Arla’s picture

Why not add 'host' in there too.

ciss’s picture

Why not add 'host' in there too.

@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.

ciss’s picture

@GeduR what is required to move this issue forward?