The following information can be used to setup document download tracking events within Google Analytics, using Google Tag Manager.

It is highly recommended that you create the Trigger, before you create the Tag when doing this in Google Tag Manager.

1. Log in to Google Tag Manager

2. Under "Workspace" select "Triggers" from the left column menu

3. Click the "New" button

4. Click the "Choose a trigger type to begin setup..." button

5. Choose the Click trigger for "Just Links"

6. Select the "Wait for Tags" checkbox and leave the default settings

7. Select the "Check Validation" checkbox

8. Set the first pulldown to "Page URL"

9. Set the second pulldown to "matches RegEx"

10. Set the field value to  .*  (period asterisk)

11. Select the "Some Link Clicks" radio button

12. Set the first pulldown to "Click URL"

13. Set the second pulldown to "matches RegEx"

14. Set the field value to ^.*\.(pdf|doc|docx|xls|xlsx|ppt|pptx|txt)$

15. Click "Save"

NOTE: Yes, there are a lot of special characters in the regular expression. It starts with a carat ( ^ ) and ends with a dollar sign ( $ ). You may add more file types to the list by adding the extension characters with a pipe ( | ) between them, e.g.,

^.*\.(pdf|doc|docx|xls|xlsx|ppt|pptx|txt|rtf)$

GTM Document Download Trigger
Image of the Google Tag Manager Trigger configuration

Once you've created the Trigger, you can now create the Tag.

1. Click on "Tags" in the left column menu

2. Click "New"

3. Click the "Choose a tag type to begin setup..." button

4. Click on "Universal Analytics"

5. Set the "Tracking ID" field to your Google Analytics ID, "UA-########-#"

6. Set "Track Type" to "Event"

7. Set "Category" to "Document Download"

8. Set "Action" to "Click"

9. Set "Label" to "{{Click URL}}"

10. Click the "Choose a trigger to make this tag fire..." button

11. Select the Trigger you just created

12. Click "Save" in the top-right corner

13. Publish your tags

14. Add your Google Tag Manager ID to the Site Configuration tab under the site level properties in the CMS

15. Publish the site level

16. You may need to republish the top level pages of your site in order for the new Tag Manager information to become available to all pages.

GTM Document Download Tag
Image of the Google Tag Manager Tag configuration