I'm using the webform module to... create webforms! But the GA code isn't sowing up on the confirmation pages. ie. I submit the form, and am taken to a page which shows my thank you message - this page has no GA code on it.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | google_analytics-442846-path-alias.patch | 834 bytes | mrfelton |
| #3 | google_analytics-442846-path-alias.patch | 811 bytes | mrfelton |
Comments
Comment #1
hass commentedAre you able to verify if the confirmation page may be excluded by the standard path exclusion filters (for e.g. "node/*/*"? You could also post the confirmation page URL and I'm able to verify this. If this is the case you need to alter the GA path exclusion settings more specific to your site.
Comment #2
mrfelton commentedI think I know why...
in
_googleanalytics_visibility_pages, you do:I have my exclude paths set to:
My confirmation page has an alias set, which does not match any of the above, so $page_match = drupal_match_path($path, $pages) works out to be FALSE.
However, drupal_match_path($_GET['q'], $pages); works out to be TRUE, since a webform confirmation page has a url where $_GET['q'] = 'node/12345/done.
I have node/*/* set in my exclude path, as I don't want node admin pages included (I think this is a fairly standard setting?).
so:
$page_match = $page_match || drupal_match_path($_GET['q'], $pages);
returns true, because the match based on $_GET['q'] returns true...
perhaps, it should only check $_GET['q'] if there is no alias?
Comment #3
mrfelton commentedHow about this...
Comment #4
mrfelton commentedreworded code comment to make it clearer what it's doing.
Comment #5
hass commentedNo, you need to change the setting - not the code.
Replace the exclusion filter
with:
Comment #6
mrfelton commentedwhat is the reason for running the path match twice, once on the alias, and then again on the internal path?
EDIT: I mean, if I have set an alias for the node, then that is how the node will be accessed, and I should be able to write my exclude rules based on the aliases I have set. No?
Comment #7
hass commentedThis has been taken over from core block visibility... cannot remember why in a few seconds, but it have a use case.