The PDF (Portable Document Format) is one of the most important file formats. It is heavily used in various companies and industries for various purposes such as creating and sending reports, sales reports, documentation and much more. Sometimes it becomes really difficult to track PDF files. To overcome this, there are various ways with the help of which one can track PDFs. Google tag manager is one of the solutions that can be used to track PDFs.
Many websites allow downloading of marketing supplies like whitepapers or reports. These usually come in the structure of a PDF. In many instances, marketers need to track these downloads. They can take marketing conclusions based on investment in the content. Google Analytics traces page views by using a tracking pixel on an HTML page.
Tracking a PDF download goes a bit contrarily since a PDF file cannot demand a tracing pixel. Fortunately, with the aid of Google Tag Manager, there is a simple method to follow this data. First, let’s take a look at What is Google tag manager.
Google Tag Manager is an easy to use tool that enables users to operate and expand marketing tags like pieces of code or tracking pixels on the website without having to change the code. Here’s a very easy illustration of how GTM operates. Data from one website is distributed with Analytics through Google Tag Manager. GTM becomes extremely helpful when you have heaps of tags to maintain because all of the code is put in one place. Now how this tool can be used to track the PDF file is the question.
Google Tag Manager (also identified as GTM) is a tag control solution presented by Google. Using this ‘online tool’, one can use and maintain multiple marketing and analytics tags on a website or mobile app. Let’s take a look at it.
Tracking PDFs on the website can assist you to understand what drives your visitors. Google Analytics does not implicitly track PDFs activity. Users must configure Google Analytics to track downloads implicitly. Depending on the website’s structure and its resources, there are plenty of alternatives for tracking PDF file downloads. Let’s look at how this tracking operates in Google Analytics. The following are the steps:
Now the first step is: Just Log into Google Tag Manager and locate the container of the domain. Now click on ‘Variables’ on the list appearing on the left-hand. Here you can configure which variables you’d want to operate with when building the tag.
Furthermore, if you are utilizing Google Tag Manager then you can follow clicks on ‘submit’ buttons inserted on pages over the website quickly. Without applying GTM, you will have to add event tracking code, to every, submit button. This is extremely time eating and inclined to errors.
Now the goal of this variable is to configure the page path of the PDF’s URL. For this, just click the red “New” button in the User-Defined Variables segment and name this new variable “Click Path.” Below Choose Type, click the 2nd alternative, “Auto-Event Variables.” Set the Variable Type “Element URL” and the “Path” will be the Component Type.
Now here, below Choose Event, choose “Click.” This is because we want to track PDFs clicks. After that below, Configure Trigger, choose “Just Links” and uncheck the “Wait for Tags” and “Check Validation”. After that below Fire On, choose “Some Clicks.” Then set the trigger to shoot when “Click URL pairs with Regex\.pdf” This guarantees the tag shoots only when users click PDFs links.
Now, create your tag. Here you have to determine what information to send to Analytics when your trigger is discharged. For this, Click ‘Tags’ on the left side and choose to create a new tag. Below the Choose Product, choose Google Analytics after that select a Tag Type. Now add your Tracking ID, and then choose “Page View’ below Track TypeUnder Configure Tag.
After this add the Tracking ID. Now, under More Settings, select Fields to Set, name the Field “Page” and configure the value as the variable we created as Click Path in above steps. This move sets the tag to give the PDF’s URL page route or path to Analytics and present it as the “Page” variable.
There are various ways. The tag is simply a piece of code. Users can add this piece of code or tag directly to the website, or by inserting in the website template files such as header.php or users can insert the tag on their website, via Google Tag Manager (GTM).
Now that everything is properly configured you can test to assure it is operating correctly. For this, open two windows in your browser. In one tab, open your website and in the other tab open your Google Analytics account. Now, click on the PDF download on the website to trigger the function. Now to test, go to the Google Analytics window and click on ‘Real-time events’. This will display the event tracking analytics. Here you will find all the downloads of your PDFs from your website.
The most important benefit of using GTM is that it offers high-level analytics of PDF tracking possible for the website. GTM gives several in-built tags and variables through which one can execute high-level tracking in a short period. The identical job may need many days or weeks without GTM. With the help of GTM, if properly configured, PDFs can be tracked and can be analyzed.
About the Author
Prasanna is an independent cybersecurity consultant and technical writer, focusing on penetration testing and vulnerability assessment. He provides penetration testing services to a wide variety of clients, including financial institutions, brokerage firms, professional regulators, manufacturing companies and transportation companies.