Fix Payment Gateway Referral Sessions in GA4
The Case File
Your Google Analytics 4 property is showing sessions attributed to PayPal, Stripe, or other payment processors. These aren't genuine referral sources—they're technical artifacts of your checkout flow. Payment gateway referral sessions occur when GA4 incorrectly credits a third-party payment domain as the traffic source, rather than the original marketing channel that brought the customer to your site.
This is a Critical data quality issue. When a user leaves your website to complete payment on an external gateway and returns, GA4 can start a new session and attribute that conversion to the payment processor instead of the Google Ad, email campaign, or organic search that actually drove the sale.
The symptom is clear: your Traffic Acquisition or User Acquisition reports show domains like paypal.com, stripe.com, checkout.shopify.com, or squareup.com as referral sources, sometimes even appearing as top converters. The underlying question: Did the user's journey really start at the payment gateway, or is it just getting the final credit?
The Root Causes
Payment gateway referral sessions stem from multiple technical factors. Understanding each cause is essential for implementing a complete fix.
1. Missing Referral Exclusion Configuration
The primary cause is GA4's default behavior: any external domain that sends traffic to your site is treated as a referral source. When a customer clicks "Pay with PayPal" and leaves your domain, then returns after completing payment, GA4 sees the payment gateway's domain as the referrer and starts a new session attributed to that source.
According to Google's official documentation, GA4 treats third-party payment processors as unwanted referrals—domains that should be excluded from referral traffic attribution. Without proper configuration, these domains trigger session breakage and misattribution.
2. Session Fragmentation
Payment gateway redirects cause session fragmentation—the breaking of a single user journey into multiple disconnected sessions. This occurs because:
Cross-domain navigation without proper configuration creates a new session
Cookie limitations prevent GA4 from maintaining session continuity across domains
Client ID preservation fails when users navigate between your site and external payment processors
Session fragmentation is the root cause of most attribution issues in GA4. When sessions fragment, GA4 loses the original source/medium information, leading to either payment gateway attribution or direct traffic misattribution.
3. GTM Configuration Gaps
If you're using Google Tag Manager, several configuration issues can exacerbate payment referral problems:
Tags firing in the wrong order on the confirmation page
Missing or incorrect ignore_referrer parameter in GA4 configuration tags
Data layer race conditions where the purchase event fires before session attribution is established
Referrer variable overrides that don't account for payment gateway domains
Simo Ahava's research demonstrates that GTM-based referral exclusions require custom JavaScript variables to intercept and nullify payment gateway referrers before they reach GA4.
4. Platform-Specific Quirks
Different eCommerce platforms introduce unique challenges:
Shopify: Uses checkout.shopify.com and shop.app as intermediate domains. Without exclusions, every Shopify Checkout session appears as a referral.
WooCommerce/WordPress: Third-party payment gateways redirect to external domains (PayPal, Stripe Checkout) and back.
Custom Implementations: Developers may use iframes, pop-ups, or redirect chains that create multiple referrer handoffs.
5. Incomplete Referral Exclusion Lists
Many implementations exclude only the most obvious domains (like paypal.com) but miss variations:
Subdomain variations: www.paypal.com vs paypal.com vs checkout.paypal.com
Regional domains: paypal.co.uk, paypal.de, paypal.com.au
Buy Now, Pay Later (BNPL) services: Klarna (klarna.com), Afterpay (afterpay.com), Affirm (affirm.com)
Emerging payment methods: Apple Pay domains, Google Pay domains, cryptocurrency payment processors
6. Attribution Model Behavior
Even with referral exclusions configured, GA4's attribution behavior can create confusion. When you exclude a referral domain, GA4 doesn't attribute the session to that domain—but it still starts a new session. Depending on your attribution settings, this new session may be recorded as:
Direct traffic (if no other source information is available)
The previous session's source (if using last non-direct click attribution)
(not set) (if session parameters are lost)
This explains why fixing payment gateway referrals sometimes increases direct traffic rather than preserving the original source attribution.
The "So What?" (Business Impact)
Payment gateway referral misattribution creates cascading problems across your marketing analytics and business decisions.
Broken ROAS and Campaign Performance
Your Return on Ad Spend (ROAS) calculations become meaningless when conversions are misattributed. If a customer clicks a Google Ad, browses your site, and completes checkout via PayPal, that conversion should be attributed to Google Ads—not PayPal. Without proper exclusions:
Paid campaigns appear underperforming because conversions are stolen by payment referrals
Budget allocation decisions are based on inaccurate data
Campaign optimization targets the wrong metrics
Marketing team credibility suffers when reported performance doesn't match platform data
Inflated Session Counts
Every payment gateway redirect creates an artificial session, inflating your total session count by 10-30% in typical eCommerce implementations. This skews:
Conversion rate calculations (more sessions, same conversions = lower CVR)
Engagement metrics (average session duration, pages per session)
User behavior analysis (fragmented journeys appear as separate visits)
Data-Driven Attribution Failure
GA4's Data-Driven Attribution (DDA) model relies on complete user journey data. Session fragmentation caused by payment gateways:
Breaks attribution paths in the conversion path reports
Undervalues assist channels that occurred before the payment gateway redirect
Prevents accurate multi-touch attribution across the customer journey
Compliance and Audit Risks
Inaccurate attribution isn't just an analytics problem—it's a business governance issue:
Financial reporting based on GA4 data may be incorrect
Marketing attribution reports to stakeholders are unreliable
Data quality audits flag payment gateway referrals as critical errors
Cross-functional trust in analytics data erodes
According to research from Optimize Smart, session fragmentation and payment gateway misattribution are among the most common yet overlooked issues in GA4 implementations, affecting the majority of eCommerce properties.
The Investigation (How to Debug)
Before implementing fixes, confirm that payment gateway referral sessions exist in your GA4 property. Here's how to investigate without specialized tools.
Method 1: Traffic Acquisition Report Analysis
Navigate to Reports → Acquisition → Traffic acquisition
In the report, look at the Session default channel group dimension
Scan for Referral traffic with unusually high conversion rates
Click Add filter at the top of the report
Set Session default channel group to exactly match Referral
Add a secondary dimension: Session source or Session source/medium
Look for domains like:
paypal.com / referral
stripe.com / referral
checkout.shopify.com / referral
squareup.com / referral
shop.app / referral
Red flag: If payment gateway domains appear in your top 10 referral sources, especially with high conversion rates (often 80-100%), you have this issue.
Method 2: Exploration Report with Page Referrer
Go to Explore → Create a Free form exploration
Add dimensions:
Page referrer
Session source
Page location
Add metrics:
Sessions
Conversions
Purchase revenue (if applicable)
In the Rows section, add Page referrer
Apply a filter: Page location contains your confirmation/thank-you page URL
Examine the Page referrer values
What to look for: If your confirmation page shows payment gateway domains as referrers (e.g., https://www.paypal.com/checkoutnow, https://checkout.stripe.com/), those sessions are being misattributed.
Method 3: Real-Time Testing
Open your website in an incognito/private browser window
Add a product to cart and proceed to checkout
In a separate tab, open GA4 Real-time report
Complete the payment process using a third-party gateway (PayPal, Stripe, etc.)
Return to your site's confirmation page
Check the Real-time report → Event name → Look for session_start events
Examine the Traffic source for that session
Expected behavior: The session should maintain the original source (e.g., (direct), or your test UTM parameters), not show the payment gateway as the source.
Actual behavior (if broken): You'll see a new session attributed to the payment gateway domain.
Method 4: BigQuery Analysis (Advanced)
If you have GA4 BigQuery export enabled, run this query to identify payment gateway referrals:
sqlCopy code
SELECT
traffic_source.source,
traffic_source.medium,
COUNT(DISTINCT CONCAT(user_pseudo_id,
CAST(event_timestamp AS STRING))) AS sessions,
COUNTIF(event_name = 'purchase') AS purchases
FROM
`your_project.analytics_XXXXXX.events_*`
WHERE
_TABLE_SUFFIX BETWEEN '20250101' AND '20250131'
AND traffic_source.source IN (
'paypal.com', 'stripe.com', 'checkout.shopify.com',
'squareup.com', 'shop.app', 'klarna.com'
)
GROUP BY
traffic_source.source,
traffic_source.medium
ORDER BY
purchases DESC
This query quantifies the scope of the problem by showing exactly how many sessions and conversions are being misattributed to payment gateways.
The Solution (How to Fix)
Fixing payment gateway referral sessions requires a multi-layered approach. Implement these solutions in order of priority.
Solution 1: Configure Unwanted Referrals in GA4 Admin (Primary Fix)
This is the official Google-recommended method and should be your first implementation.
Step-by-step instructions:
Log into Google Analytics 4
Click Admin (gear icon in the bottom left)
In the Property column, click Data Streams
Click on your Web data stream
Scroll down and click Configure tag settings
In the Settings section, click Show all to expand all options
Click List unwanted referrals
Click Add condition
Under Match type, choose contains (recommended) or equals
Under Domain, enter the payment gateway domain (e.g., paypal.com)
Click Add condition to add another domain
Repeat for all payment gateways you use
Common payment gateway domains to exclude:
paypal.com (PayPal)
stripe.com (Stripe)
checkout.shopify.com (Shopify Checkout)
shop.app (Shop Pay)
squareup.com (Square)
klarna.com (Klarna)
afterpay.com (Afterpay)
affirm.com (Affirm)
2checkout.com (2Checkout)
payu.com (PayU)
skrill.com (Skrill)
paylinedata.com (Payline)
Important notes:
You can configure up to 50 unwanted referrals per data stream
Use contains match type to catch subdomains and variations
Changes take effect immediately but don't apply retroactively
You need Editor or Admin role to configure this setting
Solution 2: Historical Data Correction (Optional)
Referral exclusions are not retroactive. Historical data remains unchanged. For critical reporting:
Use BigQuery to reprocess historical events with corrected attribution logic
Create custom dimensions or calculated metrics that exclude payment gateway referrals from historical reports
Document the date when the fix was implemented to establish a "before/after" baseline
Case Closed
Finding payment gateway referral sessions manually requires navigating multiple GA4 reports, adding custom dimensions, filtering referral traffic, and cross-referencing confirmation page data—a process that can take 15-30 minutes per audit, and that's only if you know exactly what to look for.
The Watson Analytics Detective dashboard spots this Critical error instantly, alongside 60+ other data quality checks. Within seconds of connecting to your GA4 property, Watson identifies payment gateway referrals, quantifies their impact on your attribution, and flags the specific domains causing the issue—no manual digging required.
Whether you're auditing a new client's GA4 setup or conducting quarterly data quality reviews, Watson acts as your automated analytics detective, finding the clues others miss.
Discover what's hiding in your GA4 data: www.analyticsdetectives.com/watson