OT: Google Analytics help needed

Yes, i posted my question there and searched for answers - to no avail. I have 14 onClick events and am lucky to get one or two to be recognized - and those few that get recognized are *identical* to the others. Am using the more modern Asynch code - as the older code is no longer recognized. I am trying to get events to work reliably and 100 percent. Any one having WORKING code that does that?

Reply to
Robert Baer
Loading thread data ...

might help.

Reply to
Clifford Heath

I do not use Ajax even in my kitchen sink, but will look at the info for Mister Justin Case..

Reply to
Robert Baer

Hmm..in the almost futile attempt to pass events to Google Analytics, i use what they say to use, namely onclick="_gaq.push(['_trackEvent', etc&etc which seems to be a js argument. The strange thing is that (usually) one gets tagged or passed on to GA for the report; extremely inconsistent.

Reply to
Robert Baer

Then what did you mean by "Am using the more modern Asynch code"?

There are much better places to ask this. Better ways to ask, too.

Reply to
Clifford Heath

There are two set-up GA code schemes, the original "old" way and a newer, "modern" asynch code way. If you do not know the difference then you may not know enough to be of help. "Better" places? GA help and forums have not been useful, better ways? How?

I would like the parameter Hello (named arg1 in the function) to be passed and to WORK. As-is below, it acts as if arg1 is empty for the alert operation. How can this be fixed?

function pushIt(arg1) { var t=setTimeout("alert(arg1)",5000); }

Reply to
Robert Baer

Actually I switched my site just last week, and it went well. No problems, worked as advertised.

I just thought you were trying to get Google to index your DHTML, but it seems you aren't using any.

comp.lang.javascript is a lot more relevant than sci.electronics.design

The problem you have is that you pass a string to the first argument of setTimeout, and that string tries to use the value of arg1, which is not available in the dynamic eval (executed in global context).

Both the following work, but the latter is preferable (it doesn't pollute the global (aka window) namespace):

Better to just pass a function as the first argument of setTimeout:

Both these work because that capture a closure to the invocation of pushIt, which is the scope where arg1 is defined.

Anyone else you want to accuse of ignorance?

What the hell does this have to do with GA anyhow? Or with SED?

Clifford Heath.

Reply to
Clifford Heath

I am having a bitch of a problem (to be polite) getting event tracking to work reliably; of 14 events, i usually get only one trapped with its label, and maybe 5 trapped as existing but not counted as an event. I figure that if i build in a delay before the onclick="_gaq.push(['_trackEvent',etc then it ?might? work. Some GA "help" show to use the timeout function first, seperated from anything else - and that clearly does NOT work and CANNOT be useful as life goes on while the timer is ticking in the background.

Reply to
Robert Baer

vail.

ger

Google Analytics is annoying. It slows down loading the page and allows google to do more snooping than they do already. Just say no to Google Analytics.

Reply to
miso

Ahh, that make sense then. If you're debugging this in Firefox, you absolutely need to install Firebug and set breakpoints. If Chrome, the developer tools are built in. If IE, G*d help you. Get it working in the others first.

It should work as long as the user's still viewing the same page. FWIW, I put the GA tag immediately after , so it gets evaluated only after the page has (mostly) loaded. That makes the page load faster too. See the bottom of

formatting link

Clifford Heath.

Reply to
Clifford Heath

Tried your scheme, using alert() as a Q&D way of verifying, and your scheme worked. BUT...when i used the GA push(), i lost everything - zero pages, zero events. Maybe timers are useless for this..

Reply to
Robert Baer

That would be nice, but then how could one get that kind of data; like where was user - eg: china, isp - eg: baker hughes, new visitor vs returning, what day visited, which PDFs downloaded, which (other) pages visited? Javascript seems to allow the discovery of some of that but not all. And then i have the problem of how the heck to save / write that info somewhere "permanent".

Reply to
Robert Baer

Have SeaMonkey..close enough to Firefox?? I put it "at the top" because i did not want an even to get lost in case that code did not get fully loaded. In any case nothing as worked the way i would like it: that is ALL 14 events get trapped as existing and as actual (named) events. I get maybe one; it is so bad i wonder if i can count that high!

Reply to
Robert Baer

Does this have a public URL? I'll have a squizz...

Reply to
Clifford Heath

o avail.

longer

l.

nfo

All downloads are recorded in your weblog. You can see who (IP), browser, and host computer. You can also see referring websites. You probably have the "webalizer" on your server. If not, there are free and paid weblog analyzer programs.

There are times when google-analytics are just plain infuriatingly slow. You can see the url referencing at the bottom of firefox.

Reply to
miso

Be advised i just changed things for the Nth time..it is 100 percent back to the GA recommended "standard" with no additions or frills. I would appreciate it if you did not look at it until the 27th at the earliest. Use oil4less.com as it gets forwarded to oil4lessllc.com and then to the www. version.

Reply to
Robert Baer

Tou have brought to light a LOT of questions...

1) What is this "weblog" you speak of? 2) Maybe YOU can see those things mentioned, but so far i have no clue as how to do that. 3) What the heck is a "webalizer", how do i find it, and how would i go about using it?
Reply to
Robert Baer

It should be provided by whoever hosts your website. You log in to your account on their site and use whatever 'Control panel' software they provide. There are a lot of useful statistics availible that way.

--
For the last time:  I am not a mad scientist, I'm just a very ticked off
scientist!!!
Reply to
Michael A. Terrell

Hmmm. I had a look, and it all seems right, assuming you have the correct user IDs etc. In particular, your script is asynchronously fetching the gs.js script and running it. Are you seeing the results yet?

Clifford Heath.

Reply to
Clifford Heath

No, it doesn't. The GA script is loaded asynchronously, and if you request it at the end of the HTML, it doesn't even make the request until the page is ready to view (and will be ready to use as soon as any other scripts have run - the GA request is running in the background).

There is a delay before the browser shows that it has finished loading GA, but the page is fully active and functional before that.

Clifford Heath.

Reply to
Clifford Heath

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.