Google's Event Tracker Issue

J

justaguy

My first attempt to try this Google widget it and am having a problem
with it... yes, I've posted to a relevant Google forum, however, no
response yet. Thought, maybe some of you have experience with it as
well...

Problematic Page:
http://www.knowledgenotebook.com/download_dev.html

Issue:
The following code does not prompt for the software program download
as it is supposed to.
<a href="#" onClick="document.href.location='/download/
KnowledgeNoteBook_g2v4_s.exe';_gaq.push(['_trackEvent','knDownload','exe','',
1]);"><img src="images/download-now.png" alt="Download Now" /></a>

And yes, Google Tracking code is the bottom of the html code.

What am I doing wrong here?

Thanks.
 
J

justaguy

My first attempt to try this Google widget it and am having a problem
with it... yes, I've posted to a relevant Google forum, however, no
response yet.  Thought, maybe some of you have experience with it as
well...
Issue:
The following code does not prompt for the software program download
as it is supposed to.
<a href="#" onClick="document.href.location='/download/
KnowledgeNoteBook_g2v4_s.exe';_gaq.push(['_trackEvent','knDownload','exe','',
1]);"><img src="images/download-now.png" alt="Download Now" /></a>
And yes, Google Tracking code is the bottom of the html code.
What am I doing wrong here?

Your page contains invalid mark-up. The SCRIPT element may appear any
number of times *in* the HEAD or BODY of a HTML document.

Andrew Poulos

I thought I did that per Google Analytics instruction... the
index.html tracks site traffic just fine... but anyway, I move the
google script to inside the HEAD element, still to no avail.
With Chrome 12, click on the [Download] button did nothing.
With Firefox 3.6x it brought up Google Event data but the Download
Program (exe file) was prompted for downloading as it is supposed to.
They've got a bug something?
 
R

RobG

My first attempt to try this Google widget it and am having a problem
with it... yes, I've posted to a relevant Google forum, however, no
response yet.  Thought, maybe some of you have experience with it as
well...

Problematic Page:http://www.knowledgenotebook.com/download_dev.html

Issue:
The following code does not prompt for the software program download
as it is supposed to.
<a href="#" onClick="document.href.location='/download/
KnowledgeNoteBook_g2v4_s.exe';_gaq.push(['_trackEvent','knDownload','exe','',
1]);"><img src="images/download-now.png" alt="Download Now" /></a>

Why don't you use a real href?

<a href="/download/KnowledgeNoteBook_g2v4_s.exe'"
onClick="
_gaq.push(['_trackEvent','knDownload','exe','',1]);
"><img src="images/download-now.png" alt="Download Now"></a>

Now the browser can deal with the MIME type as it sees fit and
according to user preferences regardless of whether the script runs or
not.
 
J

justaguy

On 27/07/2011 11:55 AM, justaguy wrote:
My first attempt to try this Google widget it and am having a problem
with it... yes, I've posted to a relevant Google forum, however, no
response yet.  Thought, maybe some of you have experience with it as
well...
Problematic Page:
http://www.knowledgenotebook.com/download_dev.html
Issue:
The following code does not prompt for the software program download
as it is supposed to.
<a href="#" onClick="document.href.location='/download/
KnowledgeNoteBook_g2v4_s.exe';_gaq.push(['_trackEvent','knDownload','exe','',
1]);"><img src="images/download-now.png" alt="Download Now" /></a>
And yes, Google Tracking code is the bottom of the html code.
What am I doing wrong here?
Your page contains invalid mark-up. The SCRIPT element may appear any
number of times *in* the HEAD or BODY of a HTML document.
Andrew Poulos

I thought I did that per Google Analytics instruction... the
index.html tracks site traffic just fine... but anyway, I move the
google script to inside the HEAD element, still to no avail.
With Chrome 12, click on the [Download] button did nothing.
With Firefox 3.6x it brought up Google Event data but the Download
Program (exe file) was prompted for downloading as it is supposed to.
They've got a bug something?

Just an update, I've solved the problem.

The following URL works for the Google Event Tracker:
http://www.knowledgenotebook.com/download.html

Frankly Google documentation about it is poor...
 
D

dhtml

My first attempt to try this Google widget it and am having a problem
with it... yes, I've posted to a relevant Google forum, however, no
response yet.  Thought, maybe some of you have experience with it as
well...

Problematic Page:http://www.knowledgenotebook.com/download_dev.html

Issue:
The following code does not prompt for the software program download
as it is supposed to.
<a href="#" onClick="document.href.location='/download/
KnowledgeNoteBook_g2v4_s.exe';_gaq.push(['_trackEvent','knDownload','exe','',
1]);"><img src="images/download-now.png" alt="Download Now" /></a>

And yes, Google Tracking code is the bottom of the html code.

What am I doing wrong here?
WRT the download link:

| <a href="/download/KnowledgeNoteBook_g2v4_s.exe"
| onclick="javascript: _gaq.push(['_trackPageview','knDownload']);"
| ><img src="images/download-now.png" alt="Download Now" /></a>

Firefox' "Save" dialog appears, so that works.

Other problems include serving invalid XHTML, serving that as text/
html, using a rotting old version of jQuery, using a totally useless
`javascript:` label, using nonstandard, though widely implemented
`document.location` (use window.location instead). Trivia: when is
document.location null?

Server stats should provide more reliable results than client-side
javascript APIs (such as Google's), and especially for someone who's
not that strong in javascript.
 
J

justaguy

My first attempt to try this Google widget it and am having a problem
with it... yes, I've posted to a relevant Google forum, however, no
response yet.  Thought, maybe some of you have experience with it as
well...
Issue:
The following code does not prompt for the software program download
as it is supposed to.
<a href="#" onClick="document.href.location='/download/
KnowledgeNoteBook_g2v4_s.exe';_gaq.push(['_trackEvent','knDownload','exe','',
1]);"><img src="images/download-now.png" alt="Download Now" /></a>
And yes, Google Tracking code is the bottom of the html code.
What am I doing wrong here?

WRT the download link:

| <a href="/download/KnowledgeNoteBook_g2v4_s.exe"
| onclick="javascript: _gaq.push(['_trackPageview','knDownload']);"
| ><img src="images/download-now.png" alt="Download Now" /></a>

Firefox' "Save" dialog appears, so that works.

Other problems include serving invalid XHTML, serving that as text/
html, using a rotting old version of jQuery, using a totally useless
`javascript:` label, using nonstandard, though widely implemented
`document.location` (use window.location instead). Trivia: when is
document.location null?

Server stats should provide more reliable results than client-side
javascript APIs (such as Google's), and especially for someone who's
not that strong in javascript.

"Server stats should provide more reliable results"
ok, thanks for the thought.

"using a totally useless
`javascript:` label,"
yeah, found it odd, but that's exactly how Google's "expert" article
had it...

[ WRT the download link:
| <a href="/download/KnowledgeNoteBook_g2v4_s.exe"
]
And the Download page itself and other related pages would suffice for
an answer, why ask?
 
J

justaguy

My first attempt to try this Google widget it and am having a problem
with it... yes, I've posted to a relevant Google forum, however, no
response yet.  Thought, maybe some of you have experience with it as
well...
Issue:
The following code does not prompt for the software program download
as it is supposed to.
<a href="#" onClick="document.href.location='/download/
KnowledgeNoteBook_g2v4_s.exe';_gaq.push(['_trackEvent','knDownload','exe','',
1]);"><img src="images/download-now.png" alt="Download Now" /></a>

Why don't you use a real href?

  <a href="/download/KnowledgeNoteBook_g2v4_s.exe'"
   onClick="
   _gaq.push(['_trackEvent','knDownload','exe','',1]);
  "><img src="images/download-now.png" alt="Download Now"></a>

Now the browser can deal with the MIME type as it sees fit and
according to user preferences regardless of whether the script runs or
not.

Rob, I'm not sure if your value for the first argument of
"_trackEvent" would work. Thought I tried that before...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top