Closed (fixed)
Project:
Google Analytics
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
4 May 2011 at 21:22 UTC
Updated:
5 Jul 2020 at 11:13 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
philbar commentedI added the following to line 239 of Google Analytics 6.x-3.3
Right after...
Probably should make this a checkbox option to configure in the GA settings since Google is making it optional (i.e. check here for Page Load Time Tracking).
Comment #2
wiifmDefinitely would be keen to see this as an optional tickbox (ticked by default), anyone keen to have a stab at this?
Comment #3
zwoop commentedWell, it's not pretty, but this seems to do it:
Caveat: I'm not a PHP programmer :).
Comment #4
zwoop commentedI think though that the default probably should be "off".
Comment #5
dropiopio commentedhope to see this also in d7
Comment #6
NPC commentedHm, I thought it would be enough to insert this snippet in Advanced settings / Custom JavaScript code / Code snippet (after), but it doesn't seem to affect the script on my pages (flushed all caches, and loaded the page while logged out of Drupal). Perhaps I misunderstand what that field is for?
The snippet I inserted is:
_gaq.push(['_trackPageLoadTime']);Comment #7
hass commented#6 is the way to go (and correct) for now. No need to hack the modules code. You may need to clear your caches.
Comment #8
NPC commented@hass, as I wrote, I did clear my caches, so I'd like to know if anyone got it working the same way that I tried.
UPDATE: Sorry, tried in a different browser, and it works now. So you need to make sure to clear the browser cache too.
Comment #9
obrienmd commentedsubscribe
Comment #10
hass commentedWe should not enable this by default because of
Comment #11
BradleyT commented#6 is working for GA module version 6.x-3.2 however it's not recording any speeds for firefox users. This may be a bug with GA reporting though - anyone else showing time for FF users?
Comment #12
silkogelman commentedThanks for the #6 suggestion NPC!
It's a perfect bridging solution untill 'the sitespeed checkbox' is committed.
For BradleyT at #11: just enabled the script (in 6.x-3.1) , I'll let you know if it tracks Firefox users.
Comment #13
real_ate commentedsubscribe
Comment #14
gordon commentedsubscribe
Comment #15
el_reverend commentedsubscribe
Comment #16
firebus commentedI've updated the diff in #3 s.t. the default is to not track page load time, diff is against 7.x-1.x head. If some of the subscribers could test and set status to "Reviewed & Tested" that would be great!
Comment #17
firebus commentedcreated a 6.x-3.x backport issue for this as well #1157188: Page Load Tracking 6.x-3.x backport if anyone needs this for D6 (looks like the patch in #3 was a D6 patch actually!)
Comment #18
hass commentedUninstall is missing and admin.js code, too and maybe more.
Comment #19
NPC commentedWhat I posted in #6 is not a patch, it is a way to do this through the module configuration page, without hacking the code. And I am doing that on D6, yes.
By the way, it does seem to lean into Chrome in my case - out of 3.500 pageviews there were 59 page load samples, out of which 58 are Chrome, and 1 is IE. Odd, that. I wish there was a way to raise the number of samples in general, at least temporarily, since for low-traffic sites 2% of pageviews is not enough to get a good average.
Comment #20
firebus commentedNPC: sorry, i misspoke. meant #3, not #6. i've edited my earlier comments to reflect this.
hass: thank you for the feedback, here's an updated patch that removes the variable on uninstall.
the trackpageloadtime setting isn't part of the "tracking scope" vertical tab set, so i don't think there's anything to do in admin.js.
all of the tracking scope sub-tabs determine whether or not the gs code is included on a given request, based on page, user, role, etc.
trackpageloadtime isn't about whether or not the tracking code appears, but rather about what the tracking code consists of when it *is* displayed.
so i don't think that trackpageloadtime belongs in the vertical tab set.
it might make sense to combine trackpageloadtime and "custom variables" into a single "tracking features" vertical tabset, in which case it would make sense to extend admin.js as well.
please let me know what you think, or if anything else is missing.
Comment #21
firebus commentedComment #22
chriscalip commentedTested and installed on about 7 live sites on google_analytics 6.x-3.x
Although the patch @ comment#20 does not fit on google_analytics 6.x-3.x
Comment #23
chriscalip commentedI had to generate a different patch for the 6.x-3.x branch, because its not the same patch although it's the same case.
For one branch 6.x-3.x does the actual deed in hook_footer while the 7.x branch does on a hook_page_alter
Do i open the issue http://drupal.org/node/1157188 ?
Comment #24
firebus commentedi think the patch workflow is that the patch needs to be tested, and accepted, on 7.x, and then the ticket can be moved into a 6.x backport.
i'm not sure there's anything wrong with providing a D6 patch here in advance, but you should suffix it "-D6.patch" so that it doesn't get sent to the automated testing system (see the help notes under the "attach new file" field.)
Comment #25
chriscalip commentedRoger that. attach patch file with -d6 tag
Comment #27
chriscalip commentedyikes yeah my d6 patch screwed up this issue. changing it back to needs review from needs work because of my mistake.
Comment #28
hass commentedI suggest to add this to the advanced settings. At least - we should not add another new fieldset with only one checkbox.
Comment #29
firebus commentedsounds good. here is a reroll with the checkbox added to "advanced settings". i also added a link to the GA documentation of page load time in the description of the checkbox.
Comment #30
vacilando commentedSubscribing.
Comment #31
deverman commentedSubscribing
Comment #32
hass commentedCommitted to D7 and D6. Changed wording of description and title to Site Speed as named on Google pages.
Comment #34
achtonThis code is now unnecessary:
http://analytics.blogspot.com/2011/11/site-speed-now-even-easier-to-acce...
Comment #35
hass commentedThx for your note. Let's roll back the patch.
Comment #36
hass commentedRolled back and added googleanalytics_trackpageloadtime variable delete.
Comment #38
aufumy commentedIf the site get less than 1million visits per day, may need to tweak the sample size to view site speed reports.
http://code.google.com/apis/analytics/docs/gaJS/gaJSApiBasicConfiguratio...
Comment #39
hass commentedAdd the one line to custom code snippets, please.