A payment gateway is a service through which you can accept credit/debit cards and other forms of electronic payments on your website.
Stripe is an example of a payment gateway:
The use of a payment gateway can create tracking issues in Google Analytics
Many businesses use PayPal and other third party payment gateways to accept online payments. But this can create tracking issues in Google Analytics.
Whenever a customer leaves your website to make payment via a third party payment gateway and later return to your website from the gateway website, Google Analytics often attribute sales to the payment gateway instead of the original traffic source.
This is quite common in the case of PayPal. You can often find PayPal.com appearing as a top referrer in Google Analytics Referral report:
The following are the methods through which you can minimize self-referral issues while using payment gateways. I used the word ‘minimize’ because often it is not possible to completely eliminate such tracking issues.
#1 Use a Custom Shopping Cart and Custom Payment Gateway
The best way to minimize self-referral issues while using a payment gateway is, not to use any third-party payment gateway to accept online payments.
You should seriously consider using a custom shopping cart and custom payment gateway that is developed especially to meet your business needs.
There are many advantages of using custom made shopping cart but the ones which are worth highlighting are:
#1 Your customers will never leave your website to make payment and there will be little to no self-referral issues.
#2 You no longer need to depend on any third-party shopping carts and/or payment gateway or wait for updates/fixes for the foreseeable future.
It would be a one time cost for you to develop your own shopping cart but will be cheaper for your business in the long run.
Don’t just rely on services like PayPal to accept online payments. Use other payment options like wire transfer, payment upon pick-up, pay by phone, etc.
There are many businesses that just rely on services like PayPal for accepting all of their online payments and they are the ones that hit the hardest from PayPal self-referral issues in Google Analytics.
#4 Add PayPal.com to the Referral Exclusion List
But don’t do it in a hope that this will fix your PayPal referral issues and you will start tracking true referrals in Google Analytics when using PayPal.
Adding paypal.com to the referral exclusion list will not help you track the original referrer.
Exclude PayPal so that when a user returns to your website from PayPal after making payment, a new GA session is not triggered.
If you don’t exclude PayPal from being treated as a referral traffic source then whenever a user returns to your website from PayPal, a new GA session will start (provided you are using universal analytics and not classic Google Analytics) and this will inflate and skew your session/traffic data.
I often hear from clients that the referral exclusion list doesn’t work. It does work in a way that greatly reduces self-referral issues.
However, this is also true that often referral exclusion list does not completely eliminate the excluded domain(s) from appearing in the referral traffic report.
The other thing to keep in mind is that referral exclusion does not work retroactively.
Any visit/sales attributed to PayPal before adding PayPal.com to the referral exclusion list will still be attributed to PayPal in GA reports.
Therefore you need to make sure that once you have added a domain to the referral exclusion list, you look at the referral report from the time period when you first implemented referral exclusion.
#5 Add Event Tracking Code to the PayPal ‘Buy Now’ Button
PayPal provides you button code through which you can embed PayPal ‘buy now’ button on your website:
You can edit this button code and place the following event tracking code (highlighted in bold):
<input onClick=”ga(‘send’, ‘event’, { eventCategory: ‘paypal.com’, eventAction: ‘Buy Now button’});“ type=”image” src=”https://www.paypalobjects.com/en_US/GB/i/btn/btn_buynowCC_LG.gif” border=”0″ name=”submit” alt=”PayPal – The safer, easier way to pay online.”>
What this event tracking code will do is that whenever someone clicks on your PayPal button, it will record the button click and send the click data to Google Analytics.
Then later through the event tracking report you can determine the original traffic source by applying ‘source/medium’ as a secondary dimension:
Obviously, this is not a foolproof method. Whether a user completes the purchase or not after clicking on the PayPal ‘buy now’ button, the click event will always be recorded.
But you can at least get a good idea of where the majority of these PayPal transactions originally came from.
Bonus Tip: Enable ‘Auto Return’ and PDT in your PayPal Account
While this tip will not fix your Paypal self-referral issues, it will help you greatly in minimizing lost PayPal transaction data in Google Analytics.
One of the side effects of using an external payment gateway (which many marketers don’t seem to be aware of) is that there is always a strong possibility that you are not getting all of the transaction data in your Google Analytics reports.
To get all of the transaction data from a third party payment gateway, you need to make sure that your customers always return back to your website and visit the order confirmation page.
Your order confirmation page contains the ecommerce tracking code which sends the transaction data back to Google Analytics.
If a customer closes the browser window after viewing the receipt page of a third party payment gateway and does not return to your website then no ecommerce tracking code will be executed and no transaction data will be sent to Google Analytics.
You can not pass Google Analytics client ID to PayPal, as PayPal does not allow you to add the Google Analytics tracking code to its page through which it can accept client ID from your website.
You need to wait for a user to return to your website from PayPal and let him visit the order confirmation page before the PayPal transaction data can be sent to the Google Analytics server.
Many times users close the PayPal receipt page and do not return to your website. In that case, PayPal transaction data is not able to pass to the GA server.
You can greatly increase the likelihood of people returning to your website after completing the transaction by enabling ‘auto return’ and by specifying ‘Return URL’ in your PayPal account.
Follow the steps below to enable auto return in your PayPal account:
Step-1: Login to your PayPal account and then click on the ‘Profile and settings’ link as shown below:
Note: I use a PayPal business account, so the ‘profile’ link may be located in a different place in your account if you don’t use PayPal business.
Step-2: Click on the ‘My Selling Preferences’ link as shown below:
Step-3: Locate the ‘Website Preferences’ section and then click on the ‘update’ button next to it:
Step-4: Set auto return for website payment to ‘on’ and then enter the return URL as shown below:
Note: The auto return option is disabled by default.
When you turn on the ‘auto return’ setting, all users are automatically redirected back to your website once the payment has been made.
Step-5: Enable PayPal PDT. This setting is below the ‘Return URL’ text box:
Frequently Asked Questions About Tracking Google Analytics Paypal Referral and other payment gateways
What is a payment gateway?
A payment gateway is a service through which you can accept credit/debit cards and other forms of electronic payments on your website. PayPal is an example of a payment gateway.
How does using a payment gateway cause tracking issues in Google Analytics?
Whenever a customer leaves your website to make payment via a third party payment gateway and later return to your website from the gateway website, Google Analytics often attribute sales to the payment gateway instead of the original traffic source.
This is quite common in the case of PayPal. You can often find PayPal.com appearing as a top referrer in Google Analytics Referral report:
What are the different types of payment gateways?
There are two types of payment gateways: #1 External Payment Gateways #2 Direct Payment Gateways
If you are using an external payment gateway, then your customers must leave your website to complete a transaction. But if you use direct payment gateways, then your customers can complete transactions without leaving your website.
Can you completely eliminate tracking issues when using a payment gateway?
You can minimize self-referral issues while using payment gateways but often it is not possible to completely eliminate such tracking issues. The best way to minimize self-referral issues while using a payment gateway is, not to use any third-party payment gateway to accept online payments. Consider using a custom shopping cart and custom payment gateway that is developed especially to meet your business needs.
"How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."
Here’s what we’re going to cover in this training…
#1 Why digital analytics is the key to online business success.
#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.
#3 Why Google and Facebook ads don’t work for most businesses & how to make them work.
#4 Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.
#5 The number 1 reason why conversion optimization is not working for your business.
#6 How to advertise on any marketing platform for FREE with an unlimited budget.
#7 How to learn and master digital analytics and conversion optimization in record time.
My best selling books on Digital Analytics and Conversion Optimization
Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.
Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.
Attribution Modelling in Google Analytics and BeyondSECOND EDITION OUT NOW!
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.
Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.
About the Author
Himanshu Sharma
Founder, OptimizeSmart.com
Over 15 years of experience in digital analytics and marketing
Author of four best-selling books on digital analytics and conversion optimization
Nominated for Digital Analytics Association Awards for Excellence
Runs one of the most popular blogs in the world on digital analytics
Consultant to countless small and big businesses over the decade
Learn and Master Google Analytics 4 (GA4) - 126 pages ebook
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie
Duration
Description
cookielawinfo-checkbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.