Fixing paypal.com / referral in your GA4 reports on Shopify

Why payment providers steal credit for your sales in GA4, and how to fix it.

You open GA4’s traffic acquisition report and find paypal.com / referral among your best revenue sources, sometimes next to klarna.com, shop.app or an unknown bank domain. PayPal didn’t send you those customers. Your ads and emails did, and GA4 lost track of them during payment. Here is why it happens on Shopify, and how to fix it.

Why it happens

  1. A visitor arrives from a Google Ads click, adds to cart and starts the checkout.
  2. They choose PayPal (or Klarna, or a card that triggers 3-D Secure) and leave your store for the payment provider’s page.
  3. They come back to your thank-you page. The browser reports the payment provider as the referrer.
  4. GA4 sees a new referral. If the session expired while they were paying, it starts a new session from paypal.com. Even if it didn’t, the referral can take credit for the purchase in attribution reports.

The result: purchases that came from your campaigns are credited to a payment provider, and your channel reports under-value ads and email.

Check how big the problem is

  1. In GA4, open Reports → Acquisition → Traffic acquisition.
  2. Switch the dimension to Session source / medium and look at key events and revenue.
  3. Search for paypal, klarna, shop.app, pay.shopify, alma, scalapay, stripe, adyen, mollie and bank names or 3ds, acs or securecode.
  4. Compare their purchases with their sessions. A source with almost as many purchases as sessions is a payment step, not a real traffic source.

The fix: list unwanted referrals

  1. In GA4, go to Admin → Data streams and open your web stream.
  2. Click Configure tag settings, then Show more and List unwanted referrals.
  3. Add one condition per domain, with the match type “Referral domain contains”:
Payment methodDomain to add
PayPalpaypal.com
Shop Payshop.app, pay.shopify.com
Older or shared Shopify checkoutscheckout.shopify.com
Klarnaklarna.com
Almaalma.eu
Scalapayscalapay.com
Clearpay / Afterpayclearpay.co.uk, afterpay.com
Stripe, Adyen, Molliestripe.com, adyen.com, mollie.com
3-D Secure bank pagesThe domains you found in your reports

When a referral is excluded, GA4 keeps the last non-excluded source of the session, which is your original campaign only if the visitor is still recognized when they come back. Only add payment and checkout domains. Excluding a real traffic source, such as a partner site, hides it from your reports.

On Shopify, check the page referrer you send

If GA4 runs in a custom pixel, the referrer comes from your code, usually event.context.document.referrer. GA4’s unwanted referrals setting is applied by the Google tag, so it generally works with a referrer passed this way, but test it: place an order with PayPal and check the purchase in DebugView.

If the payment domain still shows up, you can tell GA4 to ignore the referrer yourself on returns from payment:

const PAYMENT_DOMAINS = ["paypal.com", "shop.app", "pay.shopify.com", "klarna.com", "alma.eu", "scalapay.com"];

const isPaymentReferrer = (ref) => {
  try {
    const host = new URL(ref).hostname;
    return PAYMENT_DOMAINS.some((d) => host === d || host.endsWith("." + d));
  } catch (e) {
    return false;
  }
};

analytics.subscribe("page_viewed", (event) => {
  const doc = event.context.document;
  window.dataLayer.push({
    event: "page_view",
    page_location: doc.location.href,
    page_referrer: doc.referrer,
    ignore_referrer: isPaymentReferrer(doc.referrer) ? "true" : undefined
  });
});

In GTM, pass ignore_referrer as a parameter on the Google tag and the page_view event. GA4 then keeps the original source of the session.

What it fixes, and what it doesn’t

  • Fixed: new purchases stop being credited to payment providers, and the original campaign keeps the credit.
  • Not fixed: past data. GA4 doesn’t reprocess history, so the change shows from the day you make it. Note the date in your reporting.
  • Not fixed: a client ID that changes between store and checkout. If purchases show as “direct” or “unassigned” instead of PayPal after the fix, the visitor isn’t recognized on the thank-you page. See how to track Shopify checkout inside the pixel sandbox.

Related settings to check at the same time

  • Cross-domain measurement (same “Configure tag settings” screen): if your store uses a separate domain for the checkout or a second storefront, list your own domains there.
  • Session timeout: the default 30 minutes is usually fine. Raising it hides the problem rather than fixing it.
  • Your own domains should never appear as referrals. If yourstore.com / referral shows up, a page is loading without the tag, or the client ID is lost somewhere.

Frequently asked questions

Where is the referral exclusion list in GA4?

Admin → Data streams → your web stream → Configure tag settings → Show more → List unwanted referrals.

How long does the referral exclusion take to work?

It applies to new data from the moment you save it, usually within a few hours. Past data isn’t changed.

Should I exclude shopify.com?

Exclude the specific payment and checkout domains (pay.shopify.com, shop.app, checkout.shopify.com) rather than all of shopify.com, so you keep visibility on any other Shopify referrals.

Why do purchases show as Direct instead of PayPal after the fix?

The visitor wasn’t recognized when they came back from payment. See Shopify purchases attributed to Direct or Unassigned.

This is one of the settings I check in every Shopify tracking audit (from 800€), and it’s part of the GA4 checklist in the complete guide to GA4 on Shopify. If your channel reports look wrong, book a free 30-minute call.

Elliot Latil

Full Stack Web Analytics expert: GA4, GTM, server-side tracking and Shopify. About me