Closed (duplicate)
Project:
Google Analytics
Version:
5.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Sep 2007 at 08:10 UTC
Updated:
16 Dec 2007 at 21:05 UTC
Jump to comment: Most recent file
Comments
Comment #1
buddaHas your theme got the
print $closure;in it?Comment #2
GioSico commentedmy theme contain(s) the required print closure.Comment #3
GioSico commentedI also tried the default garland theme and still get the same problem.
Comment #4
sebzur commentedExactly the same problem.... Any suggestion is welcome!
Comment #5
GioSico commentedI moved the module from the google_analytics folder to the googleanalytics folder and that does not fix the problem.
My theme does contain the $closure variable and a $footer_message variable but no $footer variable. I mention this as some of your other support requests are unclear about this. Even though the README is clear.
Any thoughts? Again http://www.nisekonews.com
Cheers
Comment #6
Beau Gunderson commentedI'm seeing this on 6.x-dev. Will investigate and report back.
Comment #7
Beau Gunderson commentedThis appears to be a bug where the test for variable_get is inverted in two cases.
I'm attaching a patch against 6.x. It may not apply cleanly against 5.x as there are a couple of other tiny fixes in this patch. If you are experienced with PHP you should be able to apply it manually, it's the two lines in the patch containing "variable_get".
I'm unfamiliar with module bugs; do they usually get cloned if they're present in more than one version?
Comment #8
GioSico commentedThanks for the patch ... I will see about applying it to my version ... and report back in a few days ...
Comment #9
GioSico commentedI applied portions of your D6 patch and my D5 google analytics module now works. Thank you.
Here is a patch I created but have not tested the patch itself. So use at your own risk and of course make backups first
--- googleanalytics.module.orig 2007-10-11 09:28:13.000000000 +0400
+++ googleanalytics.module 2007-10-11 09:36:25.000000000 +0400
@@ -44,12 +44,12 @@
// Check if we should track the currently active user's role
$track = TRUE;
foreach (array_keys($user->roles) as $role) {
- if (variable_get('googleanalytics_track_'. $role, FALSE)) {
+ if (!variable_get('googleanalytics_track_'. $role, FALSE)) {
$track = FALSE;
}
}
- if ($user->uid == 1 && variable_get('googleanalytics_track__user1', FALSE)) {
+ if ($user->uid == 1 && !variable_get('googleanalytics_track__user1', FALSE)) {
$track = FALSE;
}
Comment #10
buddaCommitted to Drupal5 branch.
Comment #11
hass commentedCommitted to Drupal6 branch.
Comment #12
colorado commentedI've updated to the current 5.x dev version which has the patch applied, and I have the closure code in the footer, but still no javascript is being inserted, and I can't get the module to work.
I found this http://drupal.org/node/150421#comment-240466 which suggests to put the Analytics code into a block and put the block to the footer of all pages.
Has anyone tried this with any success?
Comment #13
svogel commentedMight it be that simply the variables are wrongly set?
When I look at the config-page it says:
"Define what user roles should not be tracked by Google Analytics."
But the variables (see table variables): googleanalytics_track_* are set to 1 if the checkbox is set and 0 if it's not.
So if one would change the text to:
"Define what user roles should be tracked by Google Analytics."
than it works.
Best regards
Stefan
Comment #14
robertgarrigos commentedThat's exactly what's happenning. The user role tracking settings for this module are just working the other way round, at least for the roles listed there. User 1 is never tracked which ever has in it. You should either change that frase and leave user 1 out of it or fix the code to work as it used to.
Comment #15
xl-network commentedSame here. When I checked all the boxes (for all the roles), it was working...
Comment #16
robertgarrigos commentedI change this to critical as this module stops working when updated. Please, either change the frase on settings page or return to former functionality because if you use cvs (as I do) to update your modules from your website, this module just stops working and, what is worst, apparently everything looks the same, so webmaster can be very confused. This means that right now, hundreds of sites using this module, if updated, are not working.
Comment #17
nrambeck commentedHere's an overview of the problem in the current 5.x dev version:
The settings form for this module asks which Roles NOT to track. If a user checks the "Anonymous" role (role #1) then it sets a variable called "googleanalytics_track_1" to TRUE. This is counter-intuitive because the user just indicated he DOES NOT want to track this role yet the variable name indicates that he does want to track the role. The variable name should be changed to "googleanalytics_notrack_1", to prevent the current bug in the sytem.
The current bug is located in the googleanalytics_track() function:
The above code is assuming that if "googleanalytics_track_1" is set to FALSE, then we should not track this page. This is a good assumption based on the language of the variable, but it is wrong because the variable is set using the exact opposite logic.
I propose that all instances of "googleanalytics_track_" be changed to ""googleanalytics_notrack_" and that the above code be modified to remove the "!" in front of each variable_get() function.
Comment #18
underpressure commentedSubscribing - same issue :(
I also get this error: Validation error, please try again. If this error persists, please contact the site administrator.
Comment #19
nicholasthompsonSame issue - I thought I was going logically insane... I've read that decscription in form dozens of times now, always confirming that I had just read "NOT"... :-)
Comment #20
brianpkennedy commentedI faced this problem this morning and faced 2 problems:
1) the not track/track problem
2) I was using a custom theme that was not properly set up to call hook_footer(). Our theme_closure output a standard footer with links, and I updated it with
Hope this helps, this problem seems to be documented in multiple tickets.
Comment #21
robloachI posted a patch that fixes the logic here. If you guys would mind setting it to RTBC, I could commit it there, and then take a look at the Drupal 5 port of the patch.
Comment #22
robertgarrigos commentedI tried your patch for drupal 6 and think is RTBC. Would you port it to drupal 5?