ThriveCart (https://thrivecart.com/) is a modern shopping cart.

The integration is possible with support of Success page where order values are sent, which we use for tracking.

It is possible to track total cost, product IDs, order ID, customer name and email (supports Lifetime Commissions).

1.

Shop setup

The first step is to setup your ThriveCart. To be able to track a sale, you have to enable Success URL in each of your products. ThriveCart sends there order details, so we will place the sale tracking code there. The Success URL should be able to read URL params, that is the only requirement.
To setup Success URL of a product navigate to Products and edit it. Navigate to Product> Fulfillment section and setup a Success URL. The same for Bump> Fulfillment in case you use it.

2.

Sale tracking - per order

If you want to track per order commission, use the following code and place it to you Success page:

<script id="pap_x2s6df8d" src="http://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
PostAffTracker.setAccountId('Account_ID');
var sale = PostAffTracker.createSale();
sale.setTotalCost('<?php echo ($_GET['thrivecart']['order_total']/100) ?>');
sale.setOrderID('<?php $_GET['thrivecart']['order_id'] ?>');
sale.setProductID('<?php $_GET['thrivecart']['product_id'] ?>');

PostAffTracker.register();
</script>

The method used for sale tracking is PHP. If your site does not work with PHP, use a different approach of reading URL parameters. You can contact us in case you need a help with it.

3.

Per product tracking

In case you want to track each product separately, use the following code. The method uses PHP code.

<script id="pap_x2s6df8d" src="http://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
PostAffTracker.setAccountId('Account_ID');
<?php
$i = 0;
foreach ($_GET['thrivecart']['order'] as $product) {
  echo "var sale = PostAffTracker.createSale();";
  echo "sale.setTotalCost('".($product['p']/100)."');";
  echo "sale.setOrderID('".$_GET['thrivecart']['order_id']."($i)');";
  echo "sale.setProductID('".$product['id']."');";
}
?>
PostAffTracker.register();
</script>

That's it. Your store has just been integrated.


Do not forget to integrate your site with the click tracking code.

If you want to track additional values, you can also use currency:

$_GET['thrivecart']['order_currency']

and customer email:

$_GET['thrivecart']['customer']['email']

and customer name:

$_GET['thrivecart']['customer']['firstname']
$_GET['thrivecart']['customer']['lastname']