By jeremycaldwell on
I just installed the Google Analytics module and I am having trouble getting it to display in my HTML. I put in my "UA-xxxxxx-x" information and set it to track anonymous users as well as authenticated users. Now when I view my HTML source it doesn't show anything regarding the analytics. What am I missing here?
The site is located at www.yourjollydog.com if you want to view the source HTML. Thanks.
Comments
I have to compliment you on the design
Once of the nicer designs I've seen on the Web in a while - not sure about Google Analytics. Did you do the design or hire out?
Thanks
Thanks for the compliments. It's my wife's site and I did all the design and coding myself. I have a few other Drupal based sites in my portfolio if you want to take a look: www.eternalistic.net
And as for the Google Analytics, I know I can put the code in the template files but I'd rather have them be in there as a module.
-Jeremy
www.eternalistic.net
--
Jeremy Caldwell
www.eternalistic.net
Analytics Code
Hmmm, I allways put the Analytics code into a block and put the block to the footer of all pages. You can even filter pages where you dont like the tracking code to be displayed.
Edit: And you can define to which users it will be shown with this procedure, in case you dont want admins to be tracked.
Hope this helps, even if I cant say anything to the analytics.module...
Good idea
Not sure why I didn't think of that one before. For the time being I'll just go about adding a block to the footer to hold my Google Analytics code, thanks for the idea.
I'll set it up to show only for anonymous users too.
-Jeremy
www.eternalistic.net
--
Jeremy Caldwell
www.eternalistic.net
Great
Great that I could help a little bit ;-) If you have any further questions feel free to contact me.
Thank you
Great suggestion. I am completely new to all of this and even I could do this without any (further) assistance.
theme maybe?
Switch to Blue Marine. See if the code is visible with a view source then. If it is, then it's a problem with your theme and we can troubleshoot from there.
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
Garland
I set the theme to Garland and it still didn't spit out the code for the analytics. Oh well, I'm fine with leaving it as a block since it's pretty much the same thing as using the module. Thanks for the help and ideas.
-Jeremy
www.eternalistic.net
--
Jeremy Caldwell
www.eternalistic.net
i cant get garland to spit
i cant get garland to spit out the code either even though it has the closure variable...what gives?
I am using itheme and it
I am using itheme and it does not seem to render the needed code. I tried garland briefly and the urchin code made it's appearance. Can anyone tell me what to do about this?
I had the same problem. But
I had the same problem. But now it is resolved. The problem was with my theme. I didnt include
print $closurebefore the</body>tag. Now I added it and everything is working fine.Loving Life,
Tosho Freny,
Reading Sex and the Osho and other Dangerous Posts at BelovedOsho.com.
This solved it
Thanks! This was the problem for me.
Did You Ever Get This Working?
@pengi - Did you ever get this working? I'm using itheme, too. It has the $closure tag. I tried the Google Analytics module--installed it, added my Google user ID number and Google kept telling me "tracking unknown" no matter what I tried.
Tonight I found this thread and thought I'd give the 'pasting the code in a block' thing a whirl and still Google is telling me "tracking unknown." If I disable the module, the code doesn't show up when I view source; but when the module is enabled the code shows up. Either way, Google isn't recognizing any script at this site. Anyone have any ideas, please? Thanks.
Those Mysterious Computer Elves...
Must have been at it again. You know--the ones that come out at night and do magical things to your computer after you've shut it down? Personally, I can't detect any rhyme or reason as to whether they work good magic or bad magic on your box, but they worked the good stuff on me last night. ;)
I just checked in with Google Analytics (yes, I go around looking for signs of their activity when I'm bored) and lo and behold--it's working! So kindly disregard my previous post (unless you have connections with elves in high places and can tell me whether it was the module or the code in the blocks that made this work so I can eliminate one or the other--thanks!).
I dont have any connection
I dont have any connection with elves still....
It could be due to caching if you have enabled it. The code shows up when you are logged in and obviously google cannot login to drupal to check your code. Cache has to refresh for google to read your code.
Other than that I assume that it's either some bored imp trying some modern game with you or you have some special karmic action with Drupal system :))
Love,
Tosho Freny,
Reading why marriages fail? and Sex and the Osho at http://www.belovedosho.com/
No Special Drupal Karma Here--Trust Me!
I didn't/don't have caching enabled. Nor is Google Analytics working again either. :(
Earlier, someone in this thread mentioned caching. I didn't recall enabling it but wasn't sure what the default setting was so I went to check. I couldn't remember where I had seen the option, but a quick, cursory look through some Drupal settings didn't produce any results so I logged into the Google Analytics account and was looking around in there. That's when I discovered something weird. Somehow (and I don't know how because I didn't do it) there was a second, unnamed account created but only one account was logging tracking info.
I contacted Google and had them delete the account that wasn't working and I also removed the blocks with the code in from the site so that the only thing that should be producing the Analytics code is the Google Analytics module.
I understand (I think) what you're saying about being logged in, however, if I go to the site now, clear the cache, do not log in and view the source code it shows the script right before the closing body tag where it should be...but if I log into Google, it's not showing any activity at all for the past few weeks (yet I know there has been some as the Drupal logs indicate as much). So that's what I don't understand--if the module wasn't working there shouldn't be anything showing up in the source code, right? Yet the code is there and there is site traffic but Google doesn't know it.
Ideas? Advice? Suggestions? Anyone?
Same here
I believe I have the same problem.
I have the module enabled, able to see the script in the source view of my webpage, but google says it's not enabled yet.
So, continuing to dig in. If you get a breakthru, please post.
Software Testing Concepts - my first drupal website
http://www.softwaretestingconcepts.com
Analytics code displayed on page
I now disabled the google analytics module, created a block, copied the analytics code in there, put the block in the footer.
I noticed that google now recognised it.
However, the code appears in the footer. See my website. Any thoughts, please?
Software Testing Concepts - my first drupal website
http://www.softwaretestingconcepts.com
Looking at your source, it
Looking at your source, it changed all your tags for the tracking code, for instance < became < and etc. Also, just as a note, you are using the old tracking code, which will not allow you to take advantage of new features in Analytics. The new code uses a ga.js instead of urchin.js.
Close, but Not Exactly the Same
In my case, Google is showing that it's receiving data; I've even got the green check mark in the status information box. Yet if I click on 'View Reports' all I see is a flat line and a bunch of zeros for stats all the way back to January.
I've just tried putting the code in the block again since that seemed to work for you.
My results:
--The code isn't showing up in the page source view.--Google says it's receiving data (but we already know we can't believe a thing Google tells me).
--I don't have the code displaying in the footer like you do either when logged in or out.
Back to square one for me, I guess. :(
I have the following settings selected for the block containing the code if it helps any:
--Users cannot control whether or not they see this block.
--Show block for Anonymous users.
--Show on every page.
Edit: Correction: I've found the code in the page source, so it *is* showing up...only it's in the wrong place. I don't know how to correct that, any ideas?
This is Enough to Drive a Person Batty!
Ok, so when I switched to using the code in the block as mentioned above, I disabled the Google Analytics module and attempted to use the new ga.js code in the block. Nothing happened, as noted.
The next day, in addition to replacing the ga.js code with the urchin.js code in the block, I re-enabled the module because I thought the module would put the code in the in the correct location...or at least it did last time. I checked in at Google today and it's working again.
So, to summarize my experience, if I disable the module--no data. If I disable the block--no data. Either way Google will tell me it's receiving data when it's not. Basically I seem to need both the block *and* the module putting the code in the wrong place in order for it to work. Go figure.