Skip to content

Revenue from Ghost memberships

View as Markdown

Credit paid Ghost memberships to the visits that led to them, by connecting the Stripe account Ghost uses and identifying signed-in members in your theme.

On this page

Ghost takes membership payments through Stripe, with the Stripe account you connected in Ghost. Reveata can read that same Stripe account, so paid memberships show up as revenue. To credit each one to a visit, Reveata then needs to know which visitor the member is, which your theme can tell it.

What you need: the Reveata snippet on your site (Install on Ghost), and access to your Ghost theme files.

1. Connect the Stripe account Ghost uses

In Reveata, open your website's Settings → Payments, choose Stripe and connect the same Stripe account that is connected in Ghost (Settings → Membership in Ghost Admin shows which one). Use a restricted key or Connect with Stripe.

Reveata imports the last 12 months of membership payments and subscriptions. Monthly and yearly renewals are counted as renewals, and MRR and churn come from the subscriptions.

At this point the payments are counted, but unattributed: Ghost creates its Stripe checkouts itself, so they carry no Reveata visitor id.

2. Identify signed-in members in your theme

Ghost Admin's code injection does not run theme helpers, so this goes in the theme. In your theme's default.hbs, just before </body>, add:

handlebars
{{#if @member}}
<script>
  window.reveata =
    window.reveata ||
    function () {
      (window.reveata.q = window.reveata.q || []).push(arguments);
    };
  reveata('identify', { userId: '{{@member.uuid}}', email: '{{@member.email}}' });
</script>
{{/if}}

Upload the edited theme again (Ghost Admin → Settings → Design, change theme, upload). Every page a signed-in member opens now tells Reveata their email. The queue line lets the call run before the deferred script has loaded.

How the match works

When Stripe reports a payment, Reveata looks for a visitor identified with the same email (the Stripe customer's email, which Ghost sets to the member's). It then credits the payment to that visitor's visits, following your attribution model.

  • Order does not matter. If the member pays before any page identified them, the payment waits as unattributed. Reveata retries unattributed payments every hour for 90 days, so it is linked the next time that member opens your site signed in.
  • Same browser, full history. When the member is identified in the browser they browsed with, all their earlier anonymous visits count, including the one that first brought them.
  • Another device. If they only ever sign in on another device, the payment is credited to that device's visits instead.
  • Browser identify must stay on. Matching by email from the browser uses Match payments using browser identify calls in Settings → Payments, which is on by default.

Only identify members when your privacy policy covers it.

Limits

  • Free members pay nothing, so there is no revenue to attribute. To count free signups, add a goal instead.
  • Everything else paid through that Stripe account is imported too, not only memberships. Connect a Stripe account that only this Ghost site uses if you want membership revenue on its own.

Check it works

  1. Open your site in a private window from a link ending in ?ref=test, and sign up for a paid tier (a cheap tier you refund afterwards works).
  2. Stay signed in and open one more page, so the identify call runs.
  3. Within the hour, the payment appears under Revenue with the source test, and the member's visitor profile shows their email.

Was this helpful?