Add Google Analytics Tracking?

Is there a way to add Google Analytics tracking (utm_campaign, utm_medium, utm_source, and utm_term) to mp3 urls in the feed?

I saw where podlove’s expert settings allow you to add ptm_file tracking. But I’m pretty sure that doesn’t work with Google Analytics.

There is no way to add GA Tracking Params. To be honest, I don’t think it would be very useful because Google can’t track Downloads even with those Params. The only way to add GA compatibility would be to programmatically use GA API and notify GA about every download when it happens.

I’m not sure why you say that, because that is precisely what Google Events is for.

See: https://support.google.com/analytics/answer/1012044?hl=en

“With Events, you can track interactions with elements embedded in your pages and screens, like buttons, links, videos, and gadgets.”

In a nutshell, you go into your Google Analytics account to the Admin section and set up a new event under Account > Property > View.

Then you just add the appropriate parameters to your URL, like this:

Change: http://domain.tld/interview.mp3
To: http://domain.tld/interview.mp3?utm_campaign=podcasts&utm_medium=mp3&utm_source=rss%20feed&utm_term=my%20keyword

Events was added as part of Universal Analytics when that was first launched.

I am aware of the utm parameters and their usefulness. The issue in this specific use case lies in exactly what you quoted (note emphasis):

“With Events, you can track interactions with elements embedded in your pages and screens, like buttons, links, videos, and gadgets.”

Download links are (mostly) not embedded in your pages, which is required for GA to be able to track them. You add a script snippet to your website so GA can track clicks. However, podcast episodes are (mostly) downloaded via RSS Feeds where GA tracking does not work. It is a technical limitation.

Okay, if I understand you correctly, the problem here is that when the link is visited, the Google tracking code never actually gets activated, right?

I see two potential fixes.

One is to make the XML document into an XHTML page so that the Google tracking code can run on it.

The other is to setup a custom WordPress page … let’s pretend it’s page ID is 1365 and name it podlove1365.

The custom page does just two things. It runs the Google tracking code, and it delivers the mp3 file.

The URL would be something like this:
http://domain.tld/podlove1365/interview.mp3?utm_campaign=podcasts&utm_medium=mp3&utm_source=rss%20feed&utm_term=my%20keyword

All feed urls would run through this custom page.

Neither solution relies on directly interacting with the Google API.

correct

Podcasting relies on RSS feeds to work and there is nothing we can (and, in my opinion, should) do about it. It’s an established standard that allows podcast clients on any platform to read your podcast feed and present your podcast to listeners.

It is of course your choice to knowingly work around that standard and only publish your podcast on your website, forcing listeners to download/listen there instead of in their favourite podcasting app. Then you have a “Google Analytics” friendly, but Listener-hostile setup.

This will not work. enclosures in feeds must be downloadable entities, not html websites.

As I said before, the only way to add GA compatibility would be to programmatically use GA API in PHP.