How do you put google analytics code on a link, for example a link on your page to a download file. Is there a way to call the analytics function from a link?
Cheers.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can track the click of the link using the
_trackPageviewfunction like so:The page view will be associated with whatever you pass to the
_trackPageviewfunction (/wherever/file.pdf in this case).Google documentation is here.