We use the same UA code on ~1,000 Drupal sites that make up the colorado.edu domain. Site owners have the option of adding an additional UA code, but all sites using our install profile get the default code so we have an overview of all activity. Unfortunately, the code in http://cgit.drupalcode.org/google_analytics/tree/googleanalytics.module?... assumes that the 404.html and 403.html are relative to the root of the domain.
// Track access denied (403) and file not found (404) pages.
if ($status == '403 Forbidden') {
// See http://www.google.com/support/analytics/bin/answer.py?answer=86927
$url_custom = '"/403.html?page=" + document.location.pathname + document.location.search + "&from=" + document.referrer';
}
elseif ($status == '404 Not Found') {
$url_custom = '"/404.html?page=" + document.location.pathname + document.location.search + "&from=" + document.referrer';
}
In our case, they are not. I understand why you are creating a path for the 404 and 403 responses, but why not use the global $base_path instead of assuming /? Even if you are only running Drupal with a UA code on a single site in a directory, this will still result in more accurate analytics.
Also, the url in the comment for that functionality is (ironically) a 404. I think https://analytics.googleblog.com/2006/09/tip-tracking-404-pages.html is the same recommendation that was being made in https://web.archive.org/web/20110409081454/http://www.google.com/support....
Comment | File | Size | Author |
---|---|---|---|
#6 | Issue-2903906-by-hass-Assuming--404html-is-at-the-ro.patch | 2.52 KB | hass |
|
Comments
Comment #2
kreynen CreditAttribution: kreynen at University of Colorado Boulder commentedComment #3
hass CreditAttribution: hass commentedComment #4
hass CreditAttribution: hass commentedThere is a word "git" in the line.
Comment #5
hass CreditAttribution: hass commenteddoubles quotes seems incorrect.
Comment #6
hass CreditAttribution: hass commentedComment #9
hass CreditAttribution: hass commented