Ad Conversion Tracking: End-to-End Setup Checklist¶
Follow this checklist top to bottom, in order, to make purchase conversions show up in Google Ads, Meta, and LinkedIn after a real sale.
Why this is needed¶
When someone clicks your ad and buys, the ad platform needs to connect that sale
back to the click. The click id (Google's gclid, Meta's fbclid, LinkedIn's
li_fat_id) lands on your sales page. But your buyer then goes to Stripe
Checkout (a different website) and finally to the PyLocket thank-you page, and
that hop drops the click id. So the conversion fires with nothing tying it to
the ad, and your dashboard stays empty.
This guide fixes that two ways at once:
- A PyLocket Buy URL captures the click id on the way into Stripe and carries it through, so it is available again after the sale.
- For Google, PyLocket also sends the conversion server-side (GA4 Measurement Protocol), which is reliable even when ad blockers or browser privacy settings break the in-page tag.
You will touch five places: the PyLocket Portal, GA4, Google Ads, Google Tag Manager, and your own sales site. Budget about 30 minutes the first time.
Step 1 - Prerequisites (PyLocket Portal)¶
- [ ] You are on a Pro subscription.
- [ ] You have connected Stripe (Settings > Sales & Payments).
- [ ] Your app has a Stripe Price ID set (app > Sales section).
- [ ] You have generated a Payment Link (app > Sales section). The Buy URL below redirects to this Payment Link.
See Sell Your App with Stripe if any of these are not done yet.
Step 2 - Get your IDs from GA4¶
- [ ] Open Google Analytics > Admin > Data Streams > your web stream.
- [ ] Copy the Measurement ID. It looks like
G-XXXXXXXXXX. - [ ] On the same screen, open Measurement Protocol API secrets > Create. Give it a name (for example "PyLocket") and copy the secret value.
- [ ] In GA4 > Admin > Events (or Key events), make sure
purchaseis marked as a key event / conversion.
Step 3 - Put your GA4 details into PyLocket¶
- [ ] In the PyLocket Portal, open your app and go to the Sales section.
- [ ] Find Ad conversion tracking.
- [ ] Paste your GA4 Measurement ID (
G-XXXXXXXXXX). - [ ] Paste your GA4 Measurement Protocol API secret.
- [ ] Click Save GA4 settings.
PyLocket will now send a server-side purchase to GA4 after every sale,
including the gclid when one is present.
Step 4 - Link GA4 to Google Ads¶
- [ ] In GA4 > Admin > Product links > Google Ads links, link your Google Ads account.
- [ ] In Google Ads > Goals > Conversions > Summary >
+ New conversion action > Import > Google Analytics 4
properties, import your GA4
purchaseevent. - [ ] In Google Ads > Settings, confirm auto-tagging is on (it adds
the
gclidto your ad clicks). It is on by default.
Step 5 - Set up Google Tag Manager (also powers Meta and LinkedIn)¶
You will have pasted your GTM container id (GTM-XXXXXXX) into the app's Sales
section under Conversion tracking (Google Tag Manager). PyLocket loads that
container on the thank-you page and pushes this purchase event to the
dataLayer:
{
"event": "purchase",
"transaction_id": "<order reference>",
"value": 60.0,
"currency": "USD",
"gclid": "<google click id, if any>",
"fbclid": "<meta click id, if any>",
"li_fat_id": "<linkedin click id, if any>",
"items": [{ "item_name": "Your App" }]
}
In GTM:
- [ ] Create Data Layer Variables for
transaction_id,value,currency,gclid,fbclid, andli_fat_id. - [ ] Create a Custom Event trigger where Event name equals
purchase. - [ ] Add a conversion tag for each platform you advertise on, all firing on
that
purchasetrigger:- Google Ads conversion tracking tag (use your conversion ID/label).
- Meta pixel / Conversions tag (reads
fbclid,value,currency). - LinkedIn Insight / conversion tag (reads
li_fat_id,value).
- [ ] Submit / Publish the container.
PyLocket does not store your Meta or LinkedIn credentials. Those tags live in your own GTM container and read the values above.
Step 6 - Wire up your sales site (the part most people miss)¶
The click id only exists on the page your ad sends people to (your sales site), so a tiny snippet there forwards it into the Buy URL.
- [ ] In the PyLocket Portal app Sales section, copy your Buy URL. It
looks like
https://get.pylocket.com/buy?app_id=.... -
[ ] Make your Buy button a link with the class
pylocket-buy, for example: -
[ ] Copy the sales-page snippet from the same section and paste it just before the closing
</body>tag of your sales page. It copies the click id from the visitor's URL onto your Buy button automatically.
Now every Buy click carries the click id into Stripe, and it comes back out after the sale.
Step 7 - Verify it works¶
- [ ] In GA4, open Admin > DebugView. Make a test purchase (or use
Stripe test mode). Within a minute or two you should see a
purchaseevent withvalue,currency,transaction_id, andgclid. - [ ] In GTM, use Preview mode on the thank-you page and confirm the
purchasetrigger fires and each platform tag fires. - [ ] In Google Ads > Conversions, your imported
purchaseconversion will appear after Google's import window (this can take a few hours, so confirm in GA4 first).
If nothing shows up¶
- The Buy button must use the Buy URL (Step 6), not the raw Payment Link, or the click id never gets captured.
- Confirm Google Ads auto-tagging is on (Step 4).
- In GA4, exclude Stripe as a referral (Admin > Data Streams > Configure tag
settings > List unwanted referrals, add
stripe.com) so the sale is not attributed to Stripe instead of your ad. - Conversions are de-duplicated by
transaction_id(your order reference), so the server-side send and any in-page tag will not double count. - Google Ads conversions imported from GA4 are delayed. Verify in GA4 DebugView first; Google Ads catches up later.
What about privacy¶
PyLocket never puts personal data in the page dataLayer (no email, no download
link). For Google's enhanced conversions, only a one-way hashed (SHA-256) email
is sent server-side. See Track Conversions for how it
works under the hood.