Excluding PayPal as a referrer in Google Analytics

NOTE: This post references Shopify as the website, but the principle is the same for anyone using Google Analytics who wants to exclude referrals from specific sources. So read on!
For about a month, my analytics for Stitch People weren’t super helpful. PayPal kept showing up as the top referral source for transactions in my Shopify store analytics. The bulk of my transactions were showing as having come from paypal.com, which I knew wasn’t really the case. But for some reason, the real referral source of these transactions was being blown away by PayPal.

What’s going on?

It turns out that Google starts a new session anytime someone comes to your site from another site. If we think about this flow when you have PayPal enabled as a payment solution in Shopify (or any other ecommerce platform for that matter), it makes sense. A user comes to your store, adds something to the cart, then goes to checkout with PayPal. They’re redirected to PayPal.com to complete their transaction, and then they come back to your site.

Because someone came to your site from another site (paypal.com in this case), Google Analytics counts it as a new session. This means that PayPal gets credit as the referral for the transaction because it was the last site someone visited before coming to your site and completing a transaction.

How to fix it

First, make sure you’re using Universal Analytics. You can follow the steps outlined here to make sure you’re upgraded.

Now, go to the Admin section in Google Analytics and select the Account you want to change. Then, head to the middle column (Property) and open up the Referral Exclusion List under Tracking Info:

Make sure you add paypal.com to this list:

You’ll also want to add the domains of any other payment gateways you’re using. Here’s the official Shopify documentation.

Session Settings

I’ve also heard reports that this doesn’t always work if a user spends a lot of time at PayPal. This could happen if someone clicks the Checkout with PayPal button, gets redirected to PayPal, and then gets distracted and comes back later to complete their checkout. If you’re running into this problem, try extending the session timeout in Session Settings. By default it’s 30 minutes, but can be changed to 4 hours max.

Why does this work?

When you add a domain to the Referral Exclusion List, it doesn’t create a new session when someone visits from one of these domains. In the case of users checking out with PayPal, Google Analytics will check the referring site (paypal.com) against this list. If it finds a match, it won’t create a new session like it was doing before. Instead, the user session will continue with the original referrer and the transaction will be credited to the right source.

Once I made this change, paypal.com stopped showing up as the referral for my transactions, giving me clear insight into where the money was really coming from.

Keep in mind:  This won’t retroactively fix all the transactions that came through with PayPal as the referrer in the past. Because analytics are just a snapshot in time, this will only work for transactions going forward.

This Post Has 22 Comments

  1. Thanks +1

  2. Nice work on this article. We are having this exact issue with our payment provider site (SagePay) appearing as the referrer, but only for around 1/3 of customers.
    Looking at what you’ve written, I can put this down to the session timeout for Analytics being around 5 minutes. Therefore, the people who spend a bit longer entering their payment info will end up starting a new session when they return.

    We’re now upgrading to Universal Analytics to fine-tune how this is handled.

    From what I understand, the caveat with adding a site to the referrer exclusion list is that it just marks these visitors as unknown, and doesn’t ‘keep’ the previous referrer (since they’ve started a new session). Therefore, bumping up the session timeout is probably going to be the primary solution.

    1. Let me know how it goes. The combination of adding the site to the exclusion list and bumping up the session timeout limit should theoretically give you the data you’re looking for.

      1. A couple of updates for you… It appears we were already on Universal Analytics and the session time was set to 30 minutes. Even after extending this to 1 hour, there was no difference. Then, I found out about using ?utm_nooverride=1 to prevent previous referrals from being overwritten:

        Sounds like the perfect solution, right? Well, we’ve implemented this for a week now, and while the number has dropped, there are still a few conversions attributed to the payment provider site. I have no idea why.

        My last resort might be to remove GA tracking on the return page entirely but add it back in on the next page, and hopefully the referrer information will have been forgotten.

  3. Cheers for this, always wondered what it was 🙂

  4. Thanks for the article. Will the conversion still show up in Analytics under another channel if we exclude paypal as a referral source?

    1. Hi Jessie–yes, it’ll still show up us a conversion for whatever channel it originally came from. Excluding PayPal should maintain the original referral source for the conversion even when someone uses PayPal to check out.

  5. We were having this issue with sagepay and all transactions were referral. So we added sagepay.com and live.sagepay.com to the referral exclusion list and left it for 4 days.
    Analytics reported no transactions at all during this period, even though they were being made. We removed the exclusion and we were back to only referrals again. So we either have useless data, or no data.

    Our session settings as indicated above are set to 2 hours as standard.

  6. Great stuff. I’ve shared this to our Shopify Entrepreneurs FB group as great explanation of the issue and solution.

  7. I’m having the same issue as the other commenters. I successfully added paypal.com to the exclusion list, but now it’s excluding their sessions entirely instead of giving credit to the previous referrer.
    How can I make it ignore paypal.com as the referrer and have Analytics use the previous referrer?

  8. AS far as I can see this solution only works if you are using the JS tracking though.
    “These settings only work with the analytics.js version of the tracking code. If you’re using the ga.js version, configure these settings in your code. If you’re transitioning to analytics.js from ga.js, customize these settings to match your previous configuration for data continuity.”

    1. Yeah, using Universal Analytics is a prerequisite to getting this to work. It’s addressed under the ‘How to Fix It’ header.

  9. Hey Spencer,
    I have a similar problem but it’s with social sign ups.

    When someone use linkedin (for example) to create an account the goal for a new user is attributed to linkedin instead of the real refer (because you go to linkedin to authorise and then you come back – similar process to paypal checkout). I cannot add linkedin to referral exclusion list because we receive good traffic from linkedin not related with this bug.

    Do you know what I can do?


    1. Hey Paulo–
      That’s a great question. In theory, my best guess would be that you’d want to filter out a more specific domain path, like ‘linkedin.com/social-signin’ instead of just ‘linkedin.com’. That way, you’d keep the more general traffic while still filtering out the traffic coming from the social login function. I don’t currently have an analytics account that deals with this, so I don’t have any data to play with. If you’d like, I’d be happy to take a look at your account and see if we can find any patterns to filter out the social logins. Shoot me an email (ssbean@gmail.com) if you want to chat!

  10. Thanks for this walkthrough. I had the same problem you had with Shopify with my course on Udemy. Simple, straightforward solution. Thanks for posting.

  11. Thank you for this article. The issue seem to have occured when we switched to Analytics Universal on Magento.Let see if this solves the problem

  12. Hi, great article, thanks! Just wondering though, will this not just lump the excluded referrals into direct/none in Google Analytics? Thanks!

    1. In theory, adding a referral exclusion won’t strip the original referral source–it’ll just exclude the domain you’ve added to this list. As an example: let’s say you are driving traffic to your site via Facebook ads, and using PayPal as your checkout gateway, but haven’t added PayPal as an excluded referral. When that person converts, it’ll show up in Google Analytics with PayPal as the referral source. If you have added PayPal as an excluded referral, however, that same person will show up with Facebook as the referral source, not Direct/None. Remember that if someone comes to your site twice from two different sites (in this example, once from Facebook and once from PayPal, since they left your site to complete their purchase and then came back to see the purchase confirmation page), Google will count the latest referral as the referral source.

  13. I see, ok, thanks Spencer, much appreciated!

  14. Thanks for that article. I think this is one of the main tasks when we try to implement a web analytics strategy. Check this kind of source and add to the referral exclusion list. Awesome!

Leave a Reply

Close Menu