Passing Transaction Data for Conversion Pixels

We have a number of places where PayKickstart passes data to the vendor or allow you to add tracking scripts.

In terms of passing data, note that in both the thank you page and the IPN, the data is always sent as a POST (like a form submit), and is never passed through the URL (i.e. a “GET”). There’s a number of good reasons for this, including that passing data as GET variables to pages we do not control often breaks the page we’re redirecting to (e.g. many vendors use page builders and many of those expect specific URL parameters – if we send them others their system often just returns an error instead of loading the page).

For conversion scripts, we have an “intermediary” page which loads directly after each purchase. This is the page where you can add conversion scripts, such as the one you have for Facebook – look in the “integrations” section of your Campaigns >> Edit Product, there is a place you can add the script to the header of the page and in the body of the page.

Go to Section 3(integrations)

Some purchase data is available to be used by your script on this page, so if you add your script to that page you can grab the available data and use inside your script.

Following is the list of available data as Javascript variables:

Payment Processor: _pk_obj.payment_processor
Order Total Amount: _pk_obj.amount
Buyer First Name: _pk_obj.buyer_first_name
Buyer Last Name: _pk_obj.buyer_last_name
Buyer Email: _pk_obj.buyer_email
Transaction ID _pk_obj.transaction_id
Invoice ID: _pk_obj.invoice_id
Transaction Time: _pk_obj.transaction_time
Product ID: _pk_obj.product_id
Product Name: _pk_obj.product_name
Campaign ID: _pk_obj.campaign_id
Campaign Name: _pk_obj.campaign_name
Custom Fields: _pk_obj.custom_{name}
replace {name} with the custom field’s name
Customer ID: _pk_obj.customer_id
Funnel ID: _pk_obj_funnel_id
Funnel Name: _pk_obj_funnel_name

The below fields will only be present in the case where an order bump was also processed. The fields will be available as part of the parent product’s data on the intermediate page (add conversion pixels to the parent product to track the bump).

Order Bump Amount: _pk_obj.bump_amount
Order Bump Transaction ID _pk_obj.bump_transaction_id
Order Bump Product ID: _pk_obj.bump_product_id
Order Bump Product Name: _pk_obj.bump_product_name
Order Bump Campaign ID: _pk_obj.bump_campaign_id
Order Bump Campaign Name: _pk_obj.bump_campaign_name

Check the example below where we show how you can use the Order Total Amount in Facebook conversion pixel.

Passing Conversion Data to Facebook

If you would like to pass the conversion data to your Facebook pixel you will need to add this line of code to your Facebook tracking pixel.

fbq('track', 'Purchase', {value: _pk_obj.amount, currency:'USD'});

Note: Replace the correct variables with the data you would like to pass to Facebook.

More information on conversion tracking: https://developers.facebook.com/docs/facebook-pixel/pixel-with-ads/conversion-tracking



NOTE: If you would like to test the conversion script firing, add the following script code to the bottom of the "body" section. This will cause the intermediate page to pop up an alert box before continuing to redirect to the next page. While the alert box is up, you can inspect the intermediate page or view its source(view page source) as needed.

<script>alert("My TEST POP-UP: Click to continue");</script>

You would want to remove this test code snippet after testing.

Related Articles