Sites that use Universal Analytics sites use different JavaScript functions than sites that use the traditional ga. Each time a visitor clicks a link to download a file, a pageview will be sent to Google Analytics and the downloaded file will appear in the Content reports.
The above configuration options require a visitor to click a link on your site to download a file. This applies to files that are directly linked from a blog, a search engine, an email, or any website. PDFs and other types of downloadable files don't trigger JavaScript. So the standard Google Analytics tracking code does not record file downloads. The same applies to user activity on a web page. If the user's action doesn't trigger your code, Google Analytics won't track it.
If you want to track events that don't execute browser-based code, you have to do some extra work. You have to tell Google Analytics what you want to track, and how to track it.
You can put some additional code on your website. Or you can use a plugin that puts the event tracking code in place for you.
Event tracking is critical to understand because it's a fundamental part of Google analytics. Event tracking is how you tell Google Analytics to record user behavior that doesn't automatically trigger your tracking code.
Usually, events are actions on the pages of your website. Common examples of events include video views, page scrolling, or file downloads. The event code sends a hit to Google with the category of the event. It also tells Google the action that occurred and gives that action a label. In the event code, you can also tell Google to assign a value to the event. An interaction event is a true or false type of command that exists within the event code. It tells Google that something did, or did not happen based on the user interacting with your webpage.
Interaction events can be used to track bounce rate more precisely. Non-interaction events don't affect your bounce rate at all. But if you don't want to add code to your files manually, there are automated alternatives. Automation is also a better solution if you need to track many downloadable files.
There are several automated solutions for tracking downloads on your website. If you have GTM on your website, all you need to do to track your downloads is create an event trigger. The trigger will record an event in Google Analytics every time a visitor clicks your download link. Within the trigger, you can use a regular expression to fire an event based on your file extensions.
This expression tells the trigger to fire if any of these extensions are present in your URLs. So, if someone clicks a link on your site that contains. And that action will record a download event in Google analytics. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Ask Question. Asked 11 years ago. Active 5 years, 11 months ago.
Viewed 1k times. Improve this question. Kiquenet Add a comment. Active Oldest Votes. I wouldnt call this a best practice and would personally consider doing it a different way.
Improve this answer. Jonathan Bates Jonathan Bates 1, 13 13 silver badges 21 21 bronze badges. Is there are reason you must use the asp:hyperlink? Is there are reason you can't just do the straight HTML that you are comfortable with? The asp:hyperlink doesn't directly support the OnClientClick, but the asp:imagebutton and asp:linkbutton do.
0コメント