How To Enable File Downloads Tracking On Your WordPress Website | Softorwebapp

How To Enable File Downloads Tracking On Your WordPress Website

Leave a Comment
Hi friends in this article we are going to see How To Enable File Downloads Tracking On Your WordPress Website
  • If you are providing pdf documents (or) any soft copy documents to your visitors then you should track the downloads then only it will be helpful to run a successful blog (or) online business.
  • In general when we talk about analytics tool Google Analytics name will come to our mind immediately.
  • Whether a website is static or dynamic type it's not a concern for Google Analytics.We just need to copy & paste the code in appropriate place given by Google Analytics.
  • After some hours we will get stats of website.Google Analytics also provide real time traffic/visitor details.Not only real time traffic/visitor details but also real data analysis
  • For Wordpress websites there are plugins available for google analytics.Though adding google analytics code is enough , it is little bit complex and time consuming.
  •  Why? We have to start from scratch for some of our requirements because not all tasks/events comes in-built with Google Analytics.One of the best example is tracking file downloads on wordpress websites.
Let we see how to track file downloads using Google Analytics:

Since we don't have inbuilt file track download option in Google Analytics.First we have to do some things in Google Tag Manager.
Goto Google Tag Manager and click Create Account.


  • In the Account Setup .Give a Name to the Account and Choose your country. 
  • Next in the container setup we have enter the domain name .Kindly note that you don't need to add http and https just type the domain name as shown in below image.For us we have selected Web as Target Platform


  • Next agree to the service by ticking the checkbox and click Yes button.
  • We will get two javascript codes and we have to paste this javascript code in the wordpress site theme's header.php file. 

  • First javascript code is just below opening head tag

  • Second javascript code is just below opening of body tag.


  •  Goto Trigger. Click Add New.
  •  Name the trigger according to your wish.We named Downloaded Document.
  • Next click Trigger Configuration Tab which is large.
  • Choose Just Links Trigger Type .
  • Choose Some Link Clicks
  • This click will lead to open another option within the trigger configuration which helps to set condition for the trigger. 
  • Next in that condition Choose the first drop down.
  • Click Choose Built in variable from the first drop down option.


  •  Choose Click URL in the Choose Built in variable

  • In the first drop down option we selected Click URL .In the second Drop Down Option choose Contains. And in the third option type .pdf . Then click Save.
  • Successfully Created Trigger will be displayed/listed in the Trigger Tab.

 Next goto Tags and click New.
  • Name the Tag According to your wish. We named "Downloaded Document"
  • Next click the Tag Configuration Tab.
  • Next choose Google Analytics Universal Analytics.
  • Next Click Dropdown in the Google Analytics Universal Analytics tag typeand Choose Event.

  •  Next in event tracking parameters of Category and Action type your desired name .We named Downloaded Document.

  • Next in Label Click the Folder like icon .This will open another window .Here choose the Click URL variable.
 After doing that label will look like above image .For Value and Non Interaction Hit leave them as it is.In Google Analytics Settings click drop down and choose {{Google Analytics Settings}}.
Next click Triggering tab.

  • We have to select the trigger which was created by us which is explained at the start of this content.
Finally click save button.
  • Next we have click submit button
Next choose Publish and Create Version and fill some details in Version Name and Version Description.Finally click Publish button.



 Next we have to go to the wordpress website .For demo purpose i added a pdf file and in sample page added button block and insert pdf url location in the button.

Also made a click and downloaded the pdf.
  • Now let we check in Google Analytics whether the pdf download is tracked or not.
  • Important Note:After entering to Google analytics be sure you have selected the correct Date Range
  • Goto Behaviour and choose Events.
In the event category we can found the Downloaded Document.In the Event action we can found the Downloaded Document.
In the Event label we can see the name of the PDF document.
We have finally used google analytics to track file downloads in wordpress websites.
To avoid this time cosumption we should use pro analytics plugins.MonsterInsights plugin will do it for you.
Be sure you have minimum Plus or Pro Plan of MonsterInsights Plugin.
  • To track downloads of documents from your wordpress website using MonsterInsights., just follow the below steps.
  • One more point we want to mention that MonsterInsights have already File extensions in their Settings.
  • For Demo Purpose we have created Sample Page and added a pdf document link in a button.
  • If you want to add an file extension just do the below step.
  • Goto MonsterInsights Settings .Click Engagements .Scroll down and look for File Downloads.Add the extension you want.To add more extensions use commas to separate them.

  • Ok,Let come back to the topic .To track file download click Reports in MonsterInsights Plugin.
  • Now in Publisher Tab we can find the Top Download Links .This list shows the download link your visitors Clicked the Most.

When we click View All Download Links Report it will open Google Analytics website. We don't have to do anything we just have to view which files are downloaded.
  • No need to create trigger and tags.Just pro/plus MonsterInsights Plugin is enough to track file downloads in wordpress website in less than 5 steps.

 That's all friends.Thank you:)

Previous Post Older Post Home

0 comments :

Post a Comment

Powered by Blogger.