views:

53

answers:

1

Hey

I tracking a download of a pdf with this code:

_gaq.push(['_trackPageview', trackLink]);

When I check the net console (firebug), it tries to load the google gif for tracking, but doesn't get loaded, see screendump here: http://screencast.com/t/MWVkZTU0OD

If I copy the url for the tracker and call it directly in the browser, it works:

A: 

Are you actually putting in trackLink as the second parameter? That's probably the source of the problem. That value, unless you manually set it somewhere, doesn't mean anything. If it's not meant to be a variable, it needs to be passed as a string by enclosing it in quotes.

Change that to either a string containing the value you'd like displayed in the content page (be sure to put it in quotes, like '/path/to/pdffilename.pdf') or, you can automatically pass it the value of the link, using this.pathname for a local file (which will pass the URL of the file without the domain) or this.href (which passes the full URL) if it's located on a different domain (for the sake of clarity.

(I'm assuming your ga code is otherwise properly instantiated.)

yc