How to Track Google Ads with GCLID & PayPal Webhooks (The Server-Side Solution)

Tracking Conversions Through Website Redirects

My small document editing website works as follows in the best case scenario:

1) A customer clicks on a Google ad.

2) They come to my website and register for an account.

3) The registration process sends them an Activation email.  The customer must click on the link in the Activation email to activate their account.

4) The customer returns to my website, logs in, and places an order.

5) They are sent to a page hosted by PayPal to pay for their order.

6) Once they pay, they are sent back to an order confirmation page on my website.

When I began advertising on Google in 2014 and for many years afterward, Google account managers told me that there was no way to track sales because customers who reach our order confirmation page are seen by Google as coming from PayPal.  In fact, these customers go first to our Activation email and then they leave our website a second time to go to PayPal.

Is there any way to track actual sales in this scenario?

A year ago, a tag team member told me that I should have a new first-time-only order confirmation page for new customers if I want to track first-time purchases only.  I do want to track first-time purchases only (because I don’t want to spend my advertising dollars on return customers).

But if I track visits to the first-time order confirmation page or even clicks on “Submit” on our order form, the customer who came from Google will appear to have come from our Activation email or from PayPal.

Thank you in advance.

The short answer is:

What causes Google Ads conversion tracking to fail after an email activation link and a PayPal redirect?

Your Google account managers were working with outdated information about cross-domain tracking limitations.

The reason for the lost attribution is that the customer’s journey is being broken multiple times (first by the Activation email click, then by the PayPal redirect), causing the original Google Click ID (gclid) to be dropped by the time the customer lands on the final order confirmation page.

The complete and modern solution is to use Google’s Offline Conversion Import feature, which allows you to attribute sales to the original Google ad click by collecting the payment confirmation from PayPalโ€™s server (via a webhook) and sending it directly to Google Ads using the Google Ads API.

You will need to capture and store the gclid right after the initial ad click and then match it to the successful payment notification you receive from PayPal’s server.

The long answer is:

Your multi-step checkout process – involving an email activation link click, an initial login/order form submission, and a PayPal redirect – creates multiple attribution breaking points.

The original Google click information (the gclid, which is the unique code linking the user back to the specific ad) is almost certainly being lost.

Here is a breakdown of why the standard conversion tracking fails and how the modern server-side solution addresses it:

The Google Ads conversion tag is a piece of JavaScript code that is meant to fire on the final ‘Thank You’ page.

It relies on a cookie, which contains the gclid, being present in the user’s browser at that moment.

When the user clicks the link in the Activation email, the new session often starts without the old gclid cookie being carried forward, especially if the email provider or web browser is strict about tracking.

The redirection to PayPal, a third-party domain, and then the return to your confirmation page is a classic cross-domain tracking challenge.

While cross-domain linking helps with this, the combination of the earlier email break, browser privacy restrictions, and the redirect itself often causes the loss of the original gclid.

When the user returns to your final confirmation page, their browser records the referrer as PayPal, not Google Ads.

The best, most reliable, and privacy-compliant way to fix this is to use Google’s Offline Conversion Import via the Google Ads API, facilitated by PayPal webhooks.

This bypasses the unreliable browser tracking completely.

The moment the customer first lands on your website from the Google ad (step 1), you must capture the gclid from the URL and store it securely on your server alongside the customer’s unique user ID or email address.

This is the only way to retain the link to the original ad click.

Instead of relying on the user’s browser to successfully redirect back to your confirmation page and fire a client-side tag, you should rely on a server-to-server communication from PayPal.

PayPal’s REST APIs or Webhooks feature allows you to register an endpoint (a URL) on your server that PayPal will directly notify whenever a payment status changes – specifically, when a sale is successfully completed (step 6, but from PayPal’s server, not the browser).

This notification is independent of the user’s browser or device.

Implement Google Tag Manager (GTM) Server Container: To manage this server-side data flow easily and cheaply, you can deploy a GTM Server Container on a cloud service like Google Cloud Platform (GCP) or a specialized hosting service like Stape.

This provides a lightweight intermediary that can receive the PayPal webhook data, format it, and forward it to Google Ads.

When your server receives the PayPal notification confirming the sale, your system matches that successful payment to the stored gclid and the order value.

Then, instead of firing a tag on the client-side, you use the Google Ads API (often a pre-built GTM Server-Side tag) to send the conversion event directly from your server to Google’s server.

This is a server-to-server import, and it includes the critical gclid, the conversion time, and the value.

This process ensures that regardless of the email clicks, browser restrictions, or the PayPal redirect, Google Ads gets a definitive, server-confirmed signal of the actual sale, fully attributed to the initial ad click via the gclid you saved at the start.

Since this transaction is confirmed by PayPal’s server, this is the highest quality, most reliable conversion data you can send.

You can also easily enforce the “first-time purchase only” rule on your server before sending the conversion to Google Ads, as you control the logic before the API call is made.

About The Author