Tracking PayPal with Google Analytics and Google AdWords

UPDATE: Read our new post on tracking PayPal with Google Analytics that gives you more accurate data in your reports.

Setting up ecommerce tracking is essential if you are selling online (and even if you don't sell online you should still be aiming to measure the value of particular conversions, interactions and engagement on your site). But not all ecommerce systems integrate with Google Analytics. If you are selling online chances are you accept PayPal as a method of payment. So how do you measure people who have purchased using PayPal?

First step, create a thank you page for successful PayPal transactions and set that URL within PayPal so visitors are returned to your site.


The problem is that when the visitor returns to your site after payment has been received (or cancelled) PayPal gets the credit for the conversion and not the original way the visitor found your site.

Steps For Tracking PayPal With Google Analytics:

1. Log into PayPal.

2. Under the 'My Account' tab click on the 'Profile' link. (If you are using the new version of PayPal then head to 'My Profile' and select 'My Selling Tools. If you are logged in, then use this link to get there, it's hard to find otherwise.)

3. Click on 'Website Payment Preferences' under 'Selling Preferences' in the right column. (If you are on the new version of PayPal, then look for 'Website Preferences'.)

4. Turn 'Auto Return' on and enter the URL of your PayPal thank you page.

Then add ?utm_nooverride=1 to the end of your URL (highlighted in blue below), this will ensure that transactions (i.e. conversions) are credited to the original traffic source, rather than PayPal.

Using Universal Analytics? Then you do not need to add ?utm_nooverride=1, instead simply add to your 'Referral Exclusion List' (within the Admin section, under 'Property' and 'Tracking Info').


For example, if a visitor came from a Google search for 'gardening book' the conversion will be credited to Google, organic, gardening book (and not PayPal).

At this point if you simply want to track the conversions using goals you can setup a new goal for the thank you page within Google Analytics. However, if you want to also get Google Analytics ecommerce tracking up and running you will need to get a little more technical.

PayPal's payment data transfer allows you to receive transaction details once a visitor is back on your site (visit the PayPal technical overview article for details).

Getting Advanced With Ecommerce Tracking:

6. Turn 'Payment Data Transfer' on.


Please note that once you turn on 'Payment Data Transfer' it will be applied to all Auto Return payments unless otherwise specified within the button or link for that Website Payment.

7. You will now either have to create your 'Buy Now' buttons or modify your existing buttons.

If you are creating new 'Buy Now' buttons leave the return URL blank (or if you specify a different URL ensure it has ?utm_nooverride=1 at the end. See the note above if you are using Universal Analytics.).

If you already have buttons on your site you will need to look for the following code:

<form action="" method="post"> ... </form>

And add the following before the element (with your correct thank you page URL):

<input type="hidden" name="return" value="">

(Again, if you are using Universal Analytics you do not need to add ?utm_nooverride=1 to the end of the URL.)

8. Finally you will need to modify your thank you page to grab the PayPal data being transfered using either the POST of GET methods (you will have to talk to your web developer or IT person if you are not familiar with the coding of your site). Basically, you will need the Google Analytics ecommerce tracking code to automatically (or dynamically) grab the correct values and place them in the code. You will be able to get total price, tax, shipping, transaction id, item name, quantity, etc.

The following example uses the Asynchronous Tracking Code (and not legacy code and not Universal Analytics code).

Example Google Analytics Ecommerce Tracking Code:

'1234', // transaction ID - required
'Acme Clothing', // affiliation or store name
'11.99', // total - required
'1.29', // tax
'5', // shipping
'San Jose', // city
'California', // state or province
'USA' // country
'1234', // transaction ID - required
'DD44', // SKU/code - required
'T-Shirt', // product name
'Green Medium', // category or variation
'11.99', // unit price - required
'1' // quantity - required

Learn about Google Analytics ecommerce tracking

For Google AdWords conversion tracking you simply need to grab the total value and pass that into the conversion script as the value.

Example Google AdWords Conversion Tracking Code:

var google_conversion_id = 1234567890; var google_conversion_language = "en_AU"; var google_conversion_format = "1"; var google_conversion_color = "666666"; var google_conversion_label = "Purchase"; if (10.0) { var google_conversion_value = $10.00

Learn about Google AdWords conversion tracking

Finally, we strongly recommend that you test everything out using the PayPal Sandbox.

If you have any questions please feel free to contact us directly and if you are located in Australia check out Loves Data Training for the best Google Analytics training available!

Thanks to ROI Revolution for inspiring this post who originally discussed Google Analytics and PayPal back in 2007.