Track Google Analytics Clicks and Downloads in Drupal

Track Google Analytics Clicks and Downloads in Drupal

Over the last week, several people have asked us about tracking Google Analytics “events” on their Drupal site.

“Events” describe anything from clicking on an external link to leave your site or downloading a file.

We’re going to use the Google Analytics module which is available for Drupal 6, 7 and 8.

  • Install and enable the Google Analytics module.
  • Go to Configuration > Google Analytics.
  • Enter your Web Property ID which is in the form of UA-xxxxxxx-yy. If you login to to your Google Analytics account, you’ll see the ID next to every site profile.
Enter your Web Property ID
  • Click the “Links and downloads” tab. This is that setting that will record events on your Drupal site.
the "Links and downloads" tab in Drupal

Now that is enabled, try clicking some links or downloading some files on your site. Have patience: the results will take a while to show in Google Analytics.

  • After some time has passed, login to your Google Analytics account.
  • Click “Behavior”, then “Events”.
The Events tab in Google Analytics

This area of Google Analytics will record the events on your site, including which links people click on (“outbound”) and the files they download (“download”).

The Events category in Google Analytics
  • Here is the “outbound” category, showing which links people click on to leave our site:
The outbound Events category in Google Analytics
  • Here is the “download” category, showing which files people download from our site:
The download Events category in Google Analytics

Author

  • Steve Burge

    Steve is the founder of OSTraining. Originally from the UK, he now lives in Sarasota in the USA. Steve's work straddles the line between teaching and web development.

0 0 votes
Article Rating
Subscribe
Notify of
2 Comments
Oldest
Newest
Inline Feedbacks
View all comments
Anthony
Anthony
7 years ago

Quite useful. Thanks!

steve
steve
7 years ago
Reply to  Anthony

Cheers Anthony

2
0
Would love your thoughts, please comment.x
()
x