MediaRon / gravity-forms-google-analytics-event-tracking

Use event tracking with Google Analytics
https://wordpress.org/plugins/gravity-forms-google-analytics-event-tracking/
GNU General Public License v2.0
65 stars 14 forks source link

Measurement protocol does not add multisite subfolder url to $dp variable #36

Open bobheinen opened 4 years ago

bobheinen commented 4 years ago

I've had some issues in Analytics on getting form submits measured in Analytics views.

My filter in Analytics only adds hits from a subdirectory (e.g. /en/ for English site).

The WordPress multisite site is setup so that every language is on a subfolder.

However, the subfolder of each subsite seems to not get sent in the Measurement Protocol hit sent by the plugin.

It looks as though the $dl parameter might have the full url location. However, as per Google documentation: (https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#dl)

"&dh and &dp parameters [..] override the hostname and path + query portions of the document location [&dl]"

See also GFGAET_Submission_Feeds.php:279 where home_url() is used, which removes the full url (including subfolder) of the subsite. IMHO, not ideal.

Please add in your plugin one of the following:

bobheinen commented 4 years ago

@ronalfy