Closed (fixed)
Project:
Boost
Version:
6.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
3 Nov 2009 at 20:39 UTC
Updated:
5 Nov 2009 at 05:47 UTC
Jump to comment: Most recent file
Comments
Comment #1
mikeytown2 commentedUse the Boost ajax stats block and Enable access log under admin/reports/settings.
Report is located at admin/reports/hits inside each report is the IP. I'm sure theres a module out there so you can follow the user by IP
http://drupal.org/project/modules?filters=drupal_core%3A87%20tid%3A119&s...
Report back here any findings so others looking can find this info in one place.
Google analytics runs client side (javascript) not server side (php) so page caching should have nothing to do with it not working. There could be a slight chance it won't work if the cached page is fairly old & on admin/settings/googleanalytics -> Advanced settings -> "Cache tracking code file locally" is checked along with "Optimize JavaScript files" being enabled and if Boost is caching javascript. No way around this, I might want to create a warning on the status page if this is set and the html expiration time is longer then 24 hours. If this is the case, disable "Cache tracking code file locally" in the googleanalytics module. No way around this, if this is what's causing the issue.
Comment #2
mikeytown2 commentedCheck for the googleanalytics module on the status page
Comment #3
mikeytown2 commentedComment #4
chadd commentedi don't think that's why it isn't working. generating the user's IP is easy, we have added a line of php to the template.php file that gets the users IP address, save that to a javascript var when the page loads, then we add that var to the custom javascript in the google analytics module so it saves that var (the user's IP) as one of our custom variables in our google analytics account.
the problem comes when the cached html page is created, it is created with the IP of the user that creates the html page, so then from then on, every user, no matter what IP, that is served that html page, gets logged into analytics with the initial user's IP, since his IP is the one the template.php file generated and subsequently boost hardcoded that IP into the cached html file.
Comment #5
mikeytown2 commentedNext time can you give more details, like the fact that you have a special template.php file? That php file will not run if your page is cached, even with the core cache. With your current setup this is not a problem specific to boost.
You will need to do an ajax callback to set that variable.
http://groups.drupal.org/node/24825
So instead of writing to the DOM you save it to a javascript variable. Once that variable has been set, trigger the google analytics code to run.
Comment #6
chadd commentedsorry, i thought the template.php file was standard to most every drupal theme, not something special we had. didn't even think to mention that.
and i understand that the template.php file will not be called if the page is cached, as i understand it, that's the whole point of boost, that it returns the html file instead of the php to make things faster.
so that was my question, how do you get the php IP address variable if the page is cached. i'll have to try it with the ajax callback. i think i know exactly how i'm going to do it now. thanks for the tip.