Documentation

Podsights works with podcasters and brands to effectively measure ROI on advertising in podcasts. We do this by determining who downloads the via an RSS integration and matching them with onsite activity via the JavaScript integration.

We outline both here.

RSS Integration

Podsights gives rich insights about who downloaded your podcast as well as where and when. Allowing you, the podcaster, to understand and grow your audience.

Analytics Prefix

The Analytics Prefix sits directly in front of the episode’s MP3 URL. Every time a Podcast player streams or downloads an episode, Podsights logs the request for processing. Every major hosting provider has support for analytics prefixes.

The fastest way to get Podsights added to your feed is to email your hosting provider the following:

To: support@your-hosting-provider.com

Subject: Analytics Prefix

Hi Support,

I need to add an Analytics Prefix to my podcast. The URL Prefix is
"https://pdst.fm/e/" and the documentation is here:
https://podsights.com/docs#analytics-prefix-for-developers.

Thanks,

____

The hosting provider will then take care of adding it for you.

Analytics Prefix for Developers

Podsights Analytics Prefix is https://pdst.fm/e/. To implement the prefix, strip the protocol of the existing URL and add https://pdst.fm/e/ to the start. Like so:

  https://traffic.libsyn.com/example/EP001_Example_Podcast.mp3?dest-id=00001

Should become:

  https://pdst.fm/e/traffic.libsyn.com/example/EP001_Example_Podcast.mp3?dest-id=00001

If the above format seems strange, you are not alone. The reason, however, is due to how RSS feed parsers and podcast players work. A simpler solution would be to URL encode the path and have it look something like this.

  https://pdst.fm?u=http%3A%2F%2Ftraffic.libsyn.com%2Fexample%2FEP001_Example_Podcast.mp3%3Fdest-id%3D00001

Apple, in particular, does not like this, because it lacks a valid audio extension (e.g. .mp3) and will not play the audio in the Podcasts app. We can get around this by appending a format to the path like so:

  https://pdst.fm/e.mp3?u=http%3A%2F%2Ftraffic.libsyn.com%2Fexample%2FEP001_Example_Podcast.mp3%3Fdest-id%3D00001

This does work, Apple will play this no problem, but the problem is with the uniqueness of the file location. While query parameters are valid resource identifiers, in practice they are often considered optional. The most common case here is utm tracking code in URLs or cache busting query params like ?updated=102123123. Because of this, some feed parsers have been known to key off only the path of the file, instead of taking into account the query parameters. Because of this, we recommend using the format:

  https://pdst.fm/e/traffic.libsyn.com/example/EP001_Example_Podcast.mp3?dest-id=00001

But will also accept this format if you are unable to limit the path to the following characters [0-9a-zA-Z._-/]:

  https://pdst.fm/e.mp3?u=http%3A%2F%2Ftraffic.libsyn.com%2Fexample%2FEP001_Example_Podcast.mp3%3Fdest-id%3D00001

Here is encoding code in a few languages

JavaScript

const url = 'http://traffic.libsyn.com/example/EP001_Example_Podcast.mp3?dest-id=00001';
const [scheme, path] = /(https?):\/\/(.*)/.exec(url).slice(1,3);

# Make sure it's a valid url
if (!/^[-0-9a-zA-Z\._\/]+[?]|[$]/.test(path)) {
  throw Error('Invalid path, may only contain [-0-9a-zA-Z._/]')
}

const redirect_url = \`\${scheme}://pdst.fm/e/\${path}\`

Python

import re
url = 'http://traffic.libsyn.com/example/EP001_Example_Podcast.mp3?dest-id=00001'
scheme, path = re.match(r'(https?):\/\/(.*)', url).groups()

if not re.match('^[-0-9a-zA-Z\._\/]+[?]|[$]',  path):
    raise ValueError('Invalid path "{}"'.format(path))

redirect_url = '{}://pdst.fm/e/{}'.format(scheme, path)

Performance

Podsights is able to collect download statistics by inserting a transparent redirect to each podcast episode in your rss feed.

Podcast listeners will never see a difference, and your podcast will continue to be served from your podcast host. Episodes will stream and download without any noticeable delay.

Our redirect is backed by a globally distributed cloud infrastructure offering better than 99.9% uptime and response times below 5ms.

JavaScript Integration

To measure the connection between download and on-site conversion Podsights provides event logging JavaScript. Set it up once, and monitor conversions across any podcast using Podsights. To get started, you will need to install the JavaScript snippet.

JavaScript Install

In the Analytics Dashboard visit Settings > Keys to obtain your keys and install the following before the end body tag:

<script>
  (function(w, d){
   var id='pdst-capture', n = 'script';
   if (!d.getElementById(id)){
     w.pdst = w.pdst || function() {(w.pdst.q = w.pdst.q || []).push(arguments);};
     var e = d.createElement(n); e.id = id; e.async=1;
     e.src = 'https://cdn.pdst.fm/ping.min.js';
     var s = d.getElementsByTagName(n)[0];
     s.parentNode.insertBefore(e, s);
   }
   w.pdst('configure', { key: 'Your Key' })
  })(window, document);
</script>

Once installed, you can measure a number of actions to increase the quality of Podsights metrics.

Product

A user viewed a product:

pdst("product", {
  value: {{product.price}}/100, // could be variant price or product price.
  currency: "USD",

  // optional product information for advanced analytics.
  product_id: "{{product.id}}",
  product_name: "{{product.title}}",
  product_type: "{{product.type}}",
  product_vendor: "{{product.vendor}}",
});

Add to Cart

A user added a product to the cart:

pdst("addtocart", {
  value: 21.20, // price
  currency: "USD",

  // optional product information for advanced analytics.
  quantity: 2,
  product_id: "{{product.id}}",
  product_name: "{{product.title}}",
  product_type: "{{product.type}}",
  product_vendor: "{{product.vendor}}",
  variant_id: "{{variant.id}}",
  variant_name: "{{variant.title}}",
});

Checkout

A user initiated a checkout:

pdst("checkout", {
  value: 10.00, // price
  currency: "USD",
  discount_code: "PODCAST_CODE",

  // optional line_items, if you would like advanced analytics.
  quantity: 3,
  line_items: [
    {
      value: 21.20,
      quantity: 1,
      product_id: "{{product.id}}",
      product_name: "{{product.title}}",
      product_type: "{{product.type}}",
      product_vendor: "{{product.vendor}}",
      variant_id: "{{variant.id}}",
      variant_name: "{{variant.title}}",
    },
    {
      value: 42.40,
      quantity: 2,
      product_id: "{{product.id}}",
      product_name: "{{product.title}}",
      product_type: "{{product.type}}",
      product_vendor: "{{product.vendor}}",
      variant_id: "{{variant.id}}",
      variant_name: "{{variant.title}}",
    }
  ]
});

Purchase

A user purchased products:

pdst("purchase", {
  value:  10.00, // price
  currency: "USD",
  discount_code: "PODCAST_CODE",

  // We will use this to match up everything in the backend.
  order_id: "12322323232",

  // optional line_items, if you would like advanced analytics.
  quantity: 3,

  line_items: [
    {
      value: 21.20,
      quantity: 1,
      product_id: "{{product.id}}",
      product_name: "{{product.title}}",
      product_type: "{{product.type}}",
      product_vendor: "{{product.vendor}}",
      variant_id: "{{variant.id}}",
      variant_name: "{{variant.title}}",
    },
    {
      value: 42.40,
      quantity: 2,
      product_id: "{{product.id}}",
      product_name: "{{product.title}}",
      product_type: "{{product.type}}",
      product_vendor: "{{product.vendor}}",
      variant_id: "{{variant.id}}",
      variant_name: "{{variant.title}}",
    }
  ]
});

Lead

A user filled in a form:

pdst("lead", {
  type: "car",
  category: "ford",
  value: 50.00, # How much you value the lead.
  currency: "USD"
});

NoScript Integration

While the JavaScript integration adds advanced capabilities to Podsights Analytics we know that it doesn’t fit with everyone’s workflow. We also offer a no script option, below.

<img height="1" width="1" style="display:none"
  src="https://ping.pdst.fm/tr.gif?key=your-key&amp;a=init"
/>

You may also use the following code to measure additional events.

Product

A user viewed a product:

<img height="1" width="1" style="display:none"
  src="https://ping.pdst.fm/tr.gif?key=your-key&amp;a=product"
/>

Add to Cart

A user added a product to the cart:

<img height="1" width="1" style="display:none"
  src="https://ping.pdst.fm/tr.gif?key=your-key&amp;a=addtocart"
/>

Checkout

A user initiated a checkout:

<img height="1" width="1" style="display:none"
  src="https://ping.pdst.fm/tr.gif?key=your-key&amp;a=checkout"
/>

Purchase

A user purchased products:

<img height="1" width="1" style="display:none"
  src="https://ping.pdst.fm/tr.gif?key=your-key&amp;a=purchase"
/>

Lead

A user filled out a contact form or signed up for your service:

<img height="1" width="1" style="display:none"
  src="https://ping.pdst.fm/tr.gif?key=your-key&amp;a=lead"
/>