Does that return any results for you? Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Google analytics track pdf downloads Ask Question. Asked 9 years, 11 months ago. Active 7 years, 7 months ago. Viewed 8k times. I know i've clicked it a couple of times Here is the code I have used.
Has anyone gotten this working? We and our partners may use cookies and third party cookies a small text file sent by your computer each time you visit our site or similar technologies to record data or to collect and store information when you visit this site. If you want to find out more about cookies, you can visit this site.
If your browser, as many others accept cookies on default, you may be able to change this setting in your browser, and you can also clear your cookies. We will ask you for your consent in order to use cookies and will also provide you with the opportunity to withdraw your consent for processing of your data where such was given without this to affect the lawfulness of processing based on consent before its withdrawal. We use these cookies with the purpose of remarketing for users and tracking different actions on our website as for instance when users submit contact form, when users clicked to our email link, when user open our "About" page or "Pricing" page, etc.
We use these cookies for the purpose of better planning our advertising budget, based on our users behavior. We use certain Facebook cookies for the purpose of better planning of our advertising budget, for the remarketing and retargeting, based on users behavior. Our partners may also set cookies from the Facebook. The tools that we listed above may use a pixel tag, which is a small graphic file that allows us and third parties to monitor the use of the site and provide us with information based on your interaction with the site.
These tags may collect the IP address from the device which you loaded the page, and the browser type.
Pixel tags are also used by our third parties to collect information when you visit our site, and the links and other actions you take on our site, and we may use this information in combination with cookies to display targeted advertisements.
Other data technologies may be used that collect comparable information for security and fraud detection purposes. Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings. If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again. This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.
Ruslan Konygin. Table of contents Introduction Why do you need file downloads tracking in Google Analytics? What is Google Tag Manager? Write a Comment Cancel reply. Facebook LinkedIn. Powered by GDPR plugin. Privacy Overview Effective Date: July 21, Our privacy policy explains how we collect, use, share and protect your personal information.
How to contact us: Email: ceo triodox. Submit it here! Subscribe to my weekly newsletter for more useful marketing tips. Let me know! Join my free Slack group for marketers interested in analytics! This is going to track when I was clicks on any kind of link on your website that has a dot PDF. Maybe you have a podcast and you actually want podcast listeners as a goal, you could have a dot mp3.
Remember, by the way, One very common mistake is To make sure that you actually publish your changes and Tag Manager, a lot of people forget to hit that final step and then make all these great changes and it never goes anywhere.
Want to read more like this from Christopher Penn? Submit a Comment Cancel reply Your email address will not be published. This is a bit more technical. The href attribute shows the destination URL of that link a. You should explain to a developer, that this new custom attribute should include some meaningful, more understandable information about the file. Maybe in your CMS, that file is already using a proper name?
This step to get a developer buy-in is the most difficult. Now, the easier part — GTM configuration. Enter the following settings:. In the Attribute Name field, you must enter the name of that custom attribute that your developer has added, e. Sometimes, file links on websites contain no file extension at all like. This principle was already covered in the previous chapter.
Try to cooperate with a developer and ask for additional data attributes, like data-filename or data-fileurl. Another option could be to ask a developer to push the file information to the Data Layer every time a visitor clicks the file link. Here is an example of the code:. Once a developer does that, you will need to check. Once you have this, create a Custom Event Trigger :.
Then create a Data Layer Variable that will return the filename:. Sometimes, I end blog posts with the most popular questions I see online related to the current topic.
This time, I have only one. Hopefully, the list will be updated in the future if I notice new trends in the comments section below. Can you track the download button in the PDF file? Usually, people refer to this button that is available when you open a PDF file in the browser like Google Chrome :.
Unfortunately, the answer to this question is no. You cannot track that because you are now viewing the PDF file directly in a browser and you cannot place tracking codes in these files. Once you get a grasp on the main concepts, like triggers, tags, variables, you should be up-and-running fairly quickly. Every time a file link is clicked, the trigger will be activated and the GA tag will be fired.
If file links on your site do not contain file names or extensions, you should cooperate with a developer:. This is so helpful, thank you!! I really appreciate how you walked through the very very basic beginner steps as well. That's why we started with the simpler solutions first. In general, the more difficult solutions provide more control. But they take more time to implement. With that in mind, let's talk about how you custom code your site to track downloads in Google Analytics.
Custom coding is the most advanced solution. It involves writing your own code. Then you have run tests using your own systems to make sure your code executes correctly. Here's an example of what your code would need to communicate with Google Analytics to track your downloads. This is not the actual code for this operation. This example is written using a computer science technique known as pseudocode. If the other options we covered so far don't work, you can try to find a third-party tool to help you track your downloads.
I know these libraries exist, or they did at one time. But, my searches to find a library to share did not produce any results. It's possible these tools were made extinct by GTM. So, I don't have an example of a third-party tool that does automatic event tracking. But I'm pretty sure there's one out there somewhere. If you can recommend a third-party tool for event tracking, please leave a comment below.
0コメント