user1072337
user1072337

Reputation: 12935

Google Adwords conversions with Stripe

I have a Ghost newsletter that has a premium subscription set up with Stripe.

Basically, people go to the /subscribe page, choose a price, get redirected to Stripe, and then upon success, get redirected to the main page /, where the url will now have this appended:

?stripe_portal=success

I want to track Google Adwords conversions when the purchase is made.

I don't know how to do that, as conversion code on the main page would also count normal visits.

Upvotes: 2

Views: 705

Answers (2)

Daniel X Moore
Daniel X Moore

Reputation: 15060

Add this conditional JavaScript to your main page:

const params = new URLSearchParams(window.location.search)
if (params.get('stripe_portal') === "success") {
  // track conversion
}

Upvotes: 0

Nolan H
Nolan H

Reputation: 7419

While this is not really a Stripe integration question, you could have the post-subscription landing page be a distinct URL where you track this, then redirect back to your home page if you choose.

Upvotes: 0

Related Questions