Note: This guide requires an active Zapier account.
Embed payment buttons from PayPal directly into your content in Ghost and collect payments for your membership content
If you’re using PayPal as a payment gateway, then you may want to integrate PayPal directly with your Ghost site. It’s possible to embed PayPal buttons on any Ghost site, and you can add new PayPal customers as Members in Ghost to give them direct access to premium membership content.
This guide explains how to create and embed PayPal buttons on a Ghost site using HTML embeds, and how to automatically add new customers as members of your Ghost site.
1. Create a PayPal business account
In order to create PayPal buttons, you’ll need an active PayPal business account. You can either create one from scratch, or convert an existing personal PayPal account to a business account.
2. Create a PayPal button
Navigate to the Seller Tools area of your PayPal dashboard and locate the PayPal Buttons option:
From here, you can decide whether to create a “Buy Now” button for one-off payments, or a “Subscribe” button for recurring subscriptions.
You can embed as many PayPal buttons as you like on your Ghost site, but it’s recommended to keep your pricing structure simple to avoid confusing potential customers. The most popular pricing configuration are two plans for monthly and yearly subscriptions.
In order to create this pricing structure, you’ll need to create two Subscribe buttons in PayPal. The first step allows you to select a name, currency, amount and billing cycle for your Subscribe buttons:
Tip: In the advanced settings area, you can optionally redirect people to a custom URL on your site when checkout is complete (such as your site’s homepage, or a custom welcome page), or if someone leaves before completing payment.
3. Use the button embed code
Once you’ve created your button(s), use the embed code provided to add the buttons to your website:
You can use this code anywhere on your Ghost site, by creating an HTML card in the editor:
Tip: It’s also possible to use the PayPal embed code directly in Ghost theme files, which is useful if you’re creating a custom /subscribe/ page within your theme.
4. Create a Zapier automation to add a new member when a payment is made
Connect your PayPal account using a Zapier automation to give your customers automatic access to member-only content on your site.
Zapier automatically creates new Members in Ghost each time someone makes a successful sale from your PayPal buttons:
It is highly recommended that you use this automation to ensure you keep everything in sync. When a customer cancels a PayPal subscription, this zap will automatically:
- Unsubscribe them from receiving emails in Ghost
- Remove them from a complimentary plan so they can't access premium content
- Add a label of "PayPal Cancelled" so you can segment them in the Ghost dashboard
6. Disable free member signup
The final step is to turn off Allow free member signup in your Members settings inside Ghost:
This means you can use the Members only content access level to publish premium content, that only your paying Members who subscribed via PayPal will be able to access.
All done! Now for the next steps...
To find out more about how to make the most of Ghost members, import a member-ready theme and much more, check out our members docs.