# Attribute revenue with Podia

> Credit Podia course, download and membership sales to the visits that brought the buyer, through Stripe.

Source: https://metricraven.com/docs/attribution-guide-with-podia  
Markdown: https://metricraven.com/docs/attribution-guide-with-podia.md  
Section: Revenue

Podia takes payments through your Stripe account but doesn't let you add the visitor ID to its checkout. Its conversion tracking code knows the buyer's email, so MetricRaven can match the Stripe payment to the visit.

> **Note:** First [install MetricRaven on Podia](https://metricraven.com/docs/install-podia) and [connect Stripe](https://metricraven.com/docs/stripe).

## Add the conversion tracking code

1. **Open Settings → Third-party code**

   In your Podia dashboard, open **Settings**, then **Third-party code**, and scroll to **Conversion tracking code**.

2. **Paste this code**

   The first script keeps the call until MetricRaven has loaded; the second passes the buyer's email.

   ```html title="Conversion tracking code"
   <script>
     window.metricraven = window.metricraven || { q: [] };
     window.metricraven.payment = window.metricraven.payment || function () {
       window.metricraven.q.push(["payment"].concat([].slice.call(arguments)));
     };
   </script>
   <script>
     try {
       if (typeof Podia !== "undefined" && Podia.Conversion && Podia.Conversion.customer) {
         window.metricraven.payment({ email: Podia.Conversion.customer.email });
       }
     } catch (e) {
       console.error("MetricRaven payment tracking error:", e);
     }
   </script>
   ```

3. **Save**

   Podia runs the conversion code only after a successful purchase.

> **Verify it works**
>
> Make a test purchase in a private window, logged out of Podia. When Stripe sync imports the payment (about a minute), it appears in **Revenue** credited to that visit's source.

## Notes

- Free products and free trials aren't revenue; their checkouts are matched to nothing.
- Renewals of a matched subscription keep the same visit through the Stripe customer.
- Matching rules, privacy and the security model: [Attribute by email](https://metricraven.com/docs/attribute-by-email).
