Regarding Google Conversation Tracking with Paypal standard payment

Regarding Google Conversation Tracking with Paypal standard payment

If you are using Google Conversion to track order at the end of page (shopthanks.asp), please take note that when a customer redirected to Paypal site to make the payment and after a success payment, they will be returned to shopthanks_displayonly.asp on your VPCart site.

The Paypal standard has Return URL and Notification URL.

Return URL will make sure your customers are returned back to your VPCart site after a payment is made.
The Return URL used in VPCart is http://www.yourvpcartsite.com/paypalresult.asp
For a success payment, paypalresult.asp will redirect to shopthanks_displayonly.asp to show the order summary details.

While the Notification URL (IPN) will be called back to your site silently and this is running in background so you will never see it.
The Callback URL used in VPCart is http://www.yourvpcartsite.com/paypalcallback.asp
For a success payment, paypalcallback.asp will redirect to shopthanks.asp to show the order summary details, to update orders record with payment status, to send order emails, and to track your Google conversation sales.

In v7.02 and v8.00, you do not need to set the Returl URL and Notification URL in your Paypal merchant account setting because VPCart already include these URLs parameters dynamically in the payment form:
<input name ="return" value ="http://www.yourvpcartsite.com/paypalresult.asp" type ="hidden">
<input name ="notify_url" value ="http://www.yourvpcartsite/paypalcallback.asp" type ="hidden">


You just need to make sure IPN is enabled in your Paypal account so that Paypal can do the call back with the dynamic URL above automatically.
To enable your IPN, please follow these steps :

  1. Log in to your PayPal account .
  2. Click Profile . (If you don't see Profile on the top right, navigate to My Account > Profile > My selling tools .)
  3. Select Profile and settings .
  4. Click My selling tools .  
  5. Click Update next to Instant payment notifications.
  6. Check that IPN is set to Enabled .

This page shopthanks_displayonly.asp is just a display and will not run execution of any database routines eg to update the payment status, and will also not running any order emailing, as well for executing the Google Conversion tracking. You also no need to insert your Google Conversion tracking code into this file shopthanks_displayonly.asp.

The reason is, Paypal will later silently run the IPN feature by calling the page http://www.yourvpcartsite.com/paypalcallback.asp to your site to update the payment status into VPCart orders table, to send th order emails, and run any Google analytics/conversation tracking.

So please make sure if you need to insert any Google Conversation tracking, please only insert into shopthanks.asp or shopthanksmerchant.asp and do not need to insert the code into shopthanks_displayonly.asp.
If you insert into both shopthanks.asp and shopthanks_displayonly.asp, it will cause your Google Conversation having double tracking for a transaction.

Please also take note, if you are using VPCart pack v8.1.0.12 and below, you will need to update two files to use latest code. Here are the changes :
1. Open file shop_google_analytic_subs.asp using notepad or text editor.

2. Locate this code (around line 19) :

if instr(lcase(request.ServerVariables("SCRIPT_NAME")), "shopthanks.asp") > 0 then
ShopUrchinECommerce
end if


3. Please replace with :

'800 - 2017.06.27 - Bug Fix: Google Analytics: Not updated if callback process
if instr(lcase(request.ServerVariables("SCRIPT_NAME")), "shopthanks.asp") > 0 or session("onshopthankspage") = "yes" then
ShopUrchinECommerce
session("onshopthankspage") = ""
end if


4. Open file shopthanks.asp using notepad or text editor.

5. Locate this code (around line 94) :

setsess "googleordertotal",getsess("OrderTotal")


6. Below that code, please insert :

'800 - 2017.06.27 - Bug Fix: Google Analytics: Not updated if callback process
session("onshopthankspage") = "yes"


7. Save both files and upload back to your site.

If you have any questions regarding this please submit a helpdesk ticket to us.


Times Viewed:
3497
Added By:
Wilson Keneshiro
Date Created:
6/22/2017
Last Updated:
8/12/2017