Reply
need help placing Google Analytics urchinTracker script in JS menus
Old 09-29-2006, 07:24 PM need help placing Google Analytics urchinTracker script in JS menus
Junior Talker

Posts: 4
Name: F. Mayes
Our nonprofit recently started using Google Analytics. We're using their "urchinTracker" code to track usage of our PDFs. An example of this code is:

Code:
onClick="javascript:urchinTracker ('/phr/SpaTOCpdf');"
I've got this tracking code successfully inserted into HTML, but my problem is that some of our PDFs are linked directly from our main menu, which is in JavaScript, and I'm not sure how to put the urchinTracker code in the JS, because the examples provided by Analytics seem to deal mainly with HTML.

The file is located at http://www.pkids.org/header.php

This is the section of code in question:

----------------------------------------------------
Code:
 window.mm_menu_0623135119_0_2 = new Menu("hepatitis",190,19,"Verdana, 
 Arial, Helvetica, 
 sans-serif",11,"#333399","#000033","#CCCCFF","#E8E8E8","left","middle",4,0,400,-5,7,true,false,true,0,true,true); 
 
mm_menu_0623135119_0_2.addMenuItem("glossary","location='glossary.php'"); 
 
mm_menu_0623135119_0_2.addMenuItem("injection tips","location='dis_hep_itips.php'"); 
 
mm_menu_0623135119_0_2.addMenuItem("kids infect kids","location='im_kik.php'"); 
 
mm_menu_0623135119_0_2.addMenuItem("labs","location='dis_hep_labs.php'"); 
 
mm_menu_0623135119_0_2.addMenuItem("links & resources","location='dis_hep_lr.php'"); 
 
mm_menu_0623135119_0_2.addMenuItem("milk thistle","window.open('pdf/milkthistle.pdf', 
 '_blank');"); 
 
mm_menu_0623135119_0_2.addMenuItem("pediatric hepatitis report","location='dis_hep_phr.php'"); 
 
mm_menu_0623135119_0_2.addMenuItem("someone you know has hbv","window.open('pdf/syk_hbv.pdf', 
 '_blank');"); 
 
mm_menu_0623135119_0_2.addMenuItem("someone you know has hcv","window.open('pdf/syk_hcv.pdf', 
 '_blank');"); 
      mm_menu_0623135119_0_2.hideOnMouseOut=true; 
      mm_menu_0623135119_0_2.bgColor='#999999'; 
      mm_menu_0623135119_0_2.menuBorder=1; 
      mm_menu_0623135119_0_2.menuLiteBgColor='#FFFFFF'; 
      mm_menu_0623135119_0_2.menuBorderBgColor='#FFFFFF';
-----------------------------------------------------------------

So you can see that we have a few PDFs, such as:



Code:
mm_menu_0623135119_0_2.addMenuItem("someone you know has hcv","window.open('pdf/syk_hcv.pdf', 
 '_blank');");
Can anyone tell me how I would use the urchinTracker code to track a
click on the above menu items that lead to PDFs? I haven't worked with JS before.



Thank you,
Franji Mayes
PKIDs
franji (at) pkids (dot) org
www.pkids.org
pkids is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 09-29-2006, 08:26 PM Re: need help placing Google Analytics urchinTracker script in JS menus
peschomd's Avatar
Experienced Talker

Posts: 32
Name: Matthew Peschong
Location: Mankato, Minnesota
Have you tried a mixture of using NON google analytical web applications to track the PDF usage?

You might want to try Cpanel X Avstats and the other statistical web app. trackers out there that will show you the popularity of a given link such as your .pdf extention files linked off your JS.

This is much easier than messing with the code non stop and possibly not finding your answer.
peschomd is offline
Reply With Quote
View Public Profile Visit peschomd's homepage!
 
Old 10-19-2006, 03:53 AM Re: need help placing Google Analytics urchinTracker script in JS menus
seomumbai's Avatar
Skilled Talker

Posts: 98
Why don't you write tht in a onload function, in which you can code as you like more than one search condotions.
seomumbai is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to need help placing Google Analytics urchinTracker script in JS menus
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11609 seconds with 12 queries