Google Analytics from a page not visited by the user - paypal

I have google analytics setup for tracking e-commerce transactions when a user returns back from the payment gateway (In this case paypal or barclaycard epdq). This works well when a user comes back to my website and visits a 'thankyou' page the google analytics code gets triggered but when the customer pays for their order and then doesn't come back to the thankyou page the analytics code doesn't get triggered and therefore the transaction doesn't show up in google analytics therefore rendering the data incomplete.
I need a way to trigger the e-commerce analytics code which is in javascript even if the user doesn't visit the page.
So when I get the server side response from paypal that the payment has been made I can then somehow trigger the analytics code here incase the user doesn't return to the thankyou page.
Thanks for your help

One alternative solution is the following:
Place the ecommerce tracking before payment --> you will record more transactions than the real one
Cancel transactions not confirmed by following Google instructions (see http://www.google.com/support/analytics/bin/answer.py?hl=en-uk&answer=72290)
It's not the perfect solution but it works.

You can setup Paypal (IPN) to call back to your site when a customer has completed a transection.
Here is the two Paypal link:
https://www.paypal.com/ipn
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/howto_html_paymentdatatransfer

Related

WordPress PayPal integration for subscription

I am currently working on developing a plugin for subscription in WordPress.
I have integrated PayPal with the plugin but the problem is that how can I get the payment status from PayPal?
I have set return parameter to my subscription page but it does not receive payment status and other parameters from PayPal.
You'll need to use IPN for that. It will POST data to your application about every transaction that hits the account so you can process them accordingly, automatically and in real-time.
You can use PayPal IPN for WordPress to get up and running quickly. It comes with lots of different hooks to trigger your own stuff based on different transaction types or payment status (note: these links are to my own website).

Paypal Rest API vs Classic Sdk

I am working with paypal first time.
I have a product and I want to integrate paypal with it.
I want to achieve the following tasks :
Client comes to my website and select a plan,which is a monthly recurring plan.
Then client is redirected to Paypal for payment.
Client makes payment.
Return backs to home page.
I have gone through the documentation of paypal and I have the following questions.
What should I use REST API or Classic Sdk, as I want to create Recurring Profile,Work with EXPRESS-CHECKOUT and REFERENCE TRANSACTIONS.
I have customers all over globe and it is stated in the documentation that, for the customers in Germany and China , I have to use REFERENCE TRANSACTION.
Some where in the documentation of Merchant SDK it is stated that the classic API's will be deprecated, so is it a good approach to use Classic SDK
I also wanted to track the transactions(payment) made by user, so that I can show him the amount that is deducted in each month in his profile details.
Please suggest a feasible solution to my problem.
Thanks in advance.
Here's what I use. I went to Web Payments Standard and created a Subscription button. (I like the unencrypted variety, but you can encrypt if you want.) In there, you set the terms of the subscription, as well as where to post the IPN message. When the IPN message comes back, you deal with it. You'll get a subscr_signup at the start along with a subscr_payment. Then, on renewals, you'll get a subscr_payment again. What I like to do is store every verified IPN message in the database for my customer.
For handling the management of those subscriptions for things like tracking info, refunds, subscription cancellations, and voids, you'll need to use NVP API, which is a very simple API. If you stored in a database every IPN message with all those fields, then you should be able to pass certain fields of those to the NVP API in order to get what you need done.
If you're worried about longevity of the APIs, then don't. All they do when they deprecate APIs is stop giving you good docs on them. They still let those older versions run. If they didn't, there would be major upheaval on the web with web commerce products breaking all over the place. However, that said, if you want to prepare for the future, then get on the Braintree Payments API because PayPal bought Braintree and that's the future of their API.

How to integrate with Paypal suggested solution: "Add payment buttons to your website"

I hope to integrate Paypal using "Add payment buttons to your website" https://developer.paypal.com/webapps/developer/docs/integration/web/ since my site only needs one time purchase so this solution is perfect.
But it requires an IPN implemented as an async solution at the merchant side to receive the transaction result. While the button redirects user to paypal.com to finish the payment process. But after that is done. User is not automatically redirected back to merchant site.
I found on the forum that I can add an "data-return" attribute in the script element so when user is done paying there is an additional link that points to the merchant site. Now since IPN is asynchronous, once user views the "data-return" page, IPN may not have been called yet. My questions are:
1. So what's the suggested solution of synchronizing between return page and IPN?
2. When testing, I found a lot of query strings are appended to the "data-return" URL, looks related to transaction result. Can I use them to replace IPN so I have a SYNCHRONOUS way of verifying the transaction result?
Thanks!
Use Payment Data Transfer (PDT, for short). https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-standard/integration-guide/paymentdatatransfer/

Opencart paypal standard not processing

I've googled like crazy and can't find a solution. I'm using opencart 1.5.5.1 with paypal standard. It processes and returns to the site and the site says the order has been processed. However, nothing shows up in the users order history or in the admin dashboard. Here's a rundown of the settings.
Transaction method - sale
All statuses set to match their title, i.e completed status set to complete
status set to enabled
On paypal website preferences
Auto Return: on
return URL http://www.mydomain.com/store/index.php?route=payment/pp_standard/callback
Payment data transfer: on
encrypted website payments: off
express checkout: no
instant payment notification url: http://www.mydomain.com/store/index.php?route=payment/pp_standard/callback
So the core issue is that the users get's taken to paypal and get's returned to the website after paying, however, an order does not show up on either the user's end, or on the owner/admin's side. Anyone have any ideas what might be causing the trouble?
Well I figured it out. It was all because I had my webstore password protected. I didn't want it to be ope to the public while I was developing it and this is what was causing the payments not to callback to my webstore. Thanks everyone for all the help!

Google analytics for Paypal and Credit cart payments

I am working on Zen-Cart Site. Google Analytics is working fine but the problem I am having is in the ecommerce section of analytics. When I log into my analytics account and I go into the ecommerce section it only gives me sales that were generated through google checkout. If any sale was generated by credit card payment or by paypal that transaction is not registered in analytics. Now I really need to know which products are being sold through all transactions on the site and I'm not getting that info properly because it only tells me which products are being sold through google checkout. How can I do this?
most sites like paypal give you the ability to have the user be redirected back to a specific page after the sale takes place. On that page (usually a "thanks for buying my stuff" page), you need to put your global GA code, as well as some custom GA code to pass info like revenue, product id(s), etc...
You can learn more about what custom GA code to put on that page at this link:
http://code.google.com/intl/en/apis/analytics/docs/tracking/gaTrackingEcommerce.html