Revenue Attribution
Ghost
Set up revenue attribution when using Faurya with Ghost CMS. Track membership subscriptions and paid content revenue.
Attribute revenue with Ghost
Make sure you've added Faurya tracking to your Ghost site and connected your Stripe account first.
1. Access Ghost Code Injection
- Log in to your Ghost admin dashboard
- Go to Settings > Code Injection
- This is where you'll add the tracking code
2. Add the Faurya tracking code
Paste this JavaScript code in the Site Header section:
<script id="Faurya-queue">
window.faurya =
window.faurya ||
function () {
window.faurya.q = window.faurya.q || [];
window.faurya.q.push(arguments);
};
</script>
<script>
try {
// Track successful member signups and payments
document.addEventListener("DOMContentLoaded", function () {
// Check if this is a successful signup/payment page
if (
window.location.href.includes("success") ||
window.location.href.includes("welcome") ||
document.querySelector("[data-members-success]") ||
document.querySelector(".gh-portal-success")
) {
// Try to get member email from various sources
const memberEmail =
document.querySelector("[data-member-email]")?.textContent ||
document.querySelector(".member-email")?.textContent ||
localStorage.getItem("ghost_member_email");
if (memberEmail) {
window.Faurya("payment", { email: memberEmail });
}
}
// Store member email when they sign up for future tracking
const memberForms = document.querySelectorAll("[data-members-form]");
memberForms.forEach((form) => {
form.addEventListener("submit", function (e) {
const emailInput = form.querySelector('input[type="email"]');
if (emailInput && emailInput.value) {
localStorage.setItem("ghost_member_email", emailInput.value);
}
});
});
});
} catch (e) {
console.error("Faurya tracking error:", e);
}
</script>3. Save the settings
Click Save to apply the code injection.
Alternative: Use Zapier (No-code option)
For non-technical users, you can use Zapier to connect Ghost and Faurya:
- Create a Zapier account
- Set up a "Ghost Member Created" trigger
- Connect it to Faurya's Payment API action
- Map the member email to track revenue attribution
This requires no coding and automatically tracks new member signups.
After a successful membership signup, you should see revenue data in your Faurya dashboard.