At Wistia, we love analytics. While ours are pretty sweet, there are lots of tools out there, like Google Analytics. While Wistia's analytics give you more in-depth information on video plays, putting basic 'video play' stats in Google Analytics can give you a better picture of your web visit metrics.
This guide is here to help you get started integrating Wistia video tracking with your Google Analytics account.
Before You Get Started
Make sure you have installed the Google Analytics tracking scripts. These are necessary for any custom tracking we do below.
If you'd like to save yourself a little time and effort, have a look at our Google Analytics Lab. It's designed to make adding the Google Analytics intrgration to your Wistia embeds super easy. All you need to do is setup the aforementioned Google Analytics tracking scripts, grab an embed and head over to the lab to configure it.
Modify Your Wistia Embed Codes
Integrating with Google Analytics is actually extremely simple thanks to the
All you need to do is paste this little snippet of code anywhere on your website,
preferably right before the
You'll need to add this to every page that contains a video you want to track. Or better yet, if you have a layout file or a footer that's shared across pages, just put it in there and you'll be good to go!
1 2 3 4 5 6 7 8 9 10 11 12
This code fires a 'Play' event to Google Analytics whenever a video on your website is played. It also fires a 'Complete' event when a viewer reaches the end of a video.
We only fire each of these events once per video per page load (that's what the
return this.unbind is for). So if a viewer plays and pauses a video over and
over again, we'll only send one play event to Google. Pretty cool.
You can extend what we've done here to pipe many more events to Google Analytics if you like. Take a look at the Player API to see what's possible.
Track viewing in Google Analytics Dashboard
Now that we have all the back-end coding out of the way, it's time to monitor how the videos are performing on your Google Analytics Dashboard.
The first step is to navigate to the Event Tracking section. Click the "Content" area of the left hand nav bar, and then select "Event Tracking". The Event Tracking section will show the total number of events, the average number of events per visit, and the Top Events. To see just the video events, select "Categories".
Using Wistia and Google Analytics is a good way to get all your top-level video analytics data in the same place you already get your other website tracking information.