# Add Google Analytics Tracking?

**URL:** <https://community.podlove.org/t/add-google-analytics-tracking/735>\
**Category:** Analytics\
**Created:** [October 12, 2016, 9:55pm UTC](https://community.podlove.org/t/add-google-analytics-tracking/735 "2016-10-12T21:55:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanitycheck](https://community.podlove.org/user_avatar/community.podlove.org/sanitycheck/32/575_2.png) [@sanitycheck](https://community.podlove.org/u/sanitycheck)\
**Post date:** [October 12, 2016, 9:55pm UTC](https://community.podlove.org/t/add-google-analytics-tracking/735/1 "2016-10-12T21:55:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ericteubert](https://community.podlove.org/user_avatar/community.podlove.org/ericteubert/32/1568_2.png) [@ericteubert](https://community.podlove.org/u/ericteubert)\
**Post date:** [October 13, 2016, 4:26am UTC](https://community.podlove.org/t/add-google-analytics-tracking/735/2 "2016-10-13T04:26:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sanitycheck](https://community.podlove.org/user_avatar/community.podlove.org/sanitycheck/32/575_2.png) [@sanitycheck](https://community.podlove.org/u/sanitycheck)\
**Post date:** [October 13, 2016, 12:13pm UTC](https://community.podlove.org/t/add-google-analytics-tracking/735/3 "2016-10-13T12:13:08Z")

</div>

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](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](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](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.

---

<div class="post-metadata">

**Author:** ![ericteubert](https://community.podlove.org/user_avatar/community.podlove.org/ericteubert/32/1568_2.png) [@ericteubert](https://community.podlove.org/u/ericteubert)\
**Post date:** [October 14, 2016, 12:31am UTC](https://community.podlove.org/t/add-google-analytics-tracking/735/4 "2016-10-14T00:31:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sanitycheck](https://community.podlove.org/user_avatar/community.podlove.org/sanitycheck/32/575_2.png) [@sanitycheck](https://community.podlove.org/u/sanitycheck)\
**Post date:** [October 14, 2016, 11:43am UTC](https://community.podlove.org/t/add-google-analytics-tracking/735/5 "2016-10-14T11:43:00Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![ericteubert](https://community.podlove.org/user_avatar/community.podlove.org/ericteubert/32/1568_2.png) [@ericteubert](https://community.podlove.org/u/ericteubert)\
**Post date:** [October 15, 2016, 3:34am UTC](https://community.podlove.org/t/add-google-analytics-tracking/735/6 "2016-10-15T03:34:56Z")

</div>

> [@sanitycheck](#):
>
> 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?

correct

> [@sanitycheck](#):
>
> 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.

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.

> [@sanitycheck](#):
>
> 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](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.

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.
