Podia makes it easy to track conversions with Google Analytics and Facebook Pixel, but it's possible to do more sophisticated tracking using our JavaScript objects 🤓

These objects can be accessed through custom code added to your Podia storefront as described in installing advanced analytics.

The Advanced Analytics feature is available on the Shaker plan. You can learn more about Podia's plans on our pricing page.

Customer Object

Every page on your Podia storefront has access to a Podia.Customer object, which represents the currently logged-in customer.

Available attributes

  • id 
  • email 
  • first_name 
  • last_name 
  • created_at 

Example object

{
    id: 7,
    email: "james@bond.com",
    first_name: "James",
    last_name: "Bond",
    created_at: 1518554863241
}

Notes

  • first_name and last_name will be null if the customer hasn't provided them.
  • created_at represents when the customer initially signed up as a UNIX timestamp (integer). If necessary, it can be used to construct a native Date object like so: var signupDate = new Date(Podia.Customer.created_at); 
  • Podia.Customer will be null  if there is no customer currently logged-in. It's a good idea to first check for the existence of a customer before attempting to access attributes. For example:
if(Podia.Customer) {
  console.log(`Customer email is ${Podia.Customer.email}.`);
  console.log(`Signed up ${new Date(Podia.Customer.created_at)}.`);
} else {
  console.log('No customer logged-in.');
}

Conversion Object

A Podia.Conversion object is available after a customer purchases a course, product, or membership subscription (both free and paid). This object is only available on the thank-you pages after checkout, and will only appear once — the Podia.Conversion object disappears if the thank-you page is refreshed to prevent duplicate tracking.

Available attributes

  • customer 
  • revenue_cents 
  • currency 
  • object 

Notes

  • customer is a Podia.Customer as described above.
  • revenue_cents will be 0  for free products and membership plans.
  • currency is the ISO code of the currency revenue_cents is denominated in.
  • object is the product or subscription that was purchased, detailed below.

Available attributes for object 

  • type The type of conversion that occurred, either "product" or "subscription". Note that "product" represents both digital downloads and online courses.
  • id The unique ID for the product or membership plan (i.e. SKU).
  • name The name of the product or membership plan that was purchased.
  • order_id The unique ID for this order or subscription (i.e. transaction ID).

Example product purchase

{
    customer: {
        id: 7,
        email: "james@bond.com",
        first_name: "James",
        last_name: "Bond",
        created_at: 1518554863241
    },

    revenue_cents: 49500,
    currency: 'USD',

    object: {
      type: 'product',
      id: 12345,
      name: "Design For Developers",
      order_id: 90210
    },
}

Finishing up

We recommend that you disable any ad-blockers and use private browsing (incognito mode) when testing your custom JavaScript integration. And remember, the Podia.Conversion object is only available immediately following a conversion and disappears on the next page request.

Give us a shout if you run into any issues — we're happy to help! Drop us a line at hello@podia.com or click the icon below to chat 👍

Did this answer your question?