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