GOAFFPRO
Search…
How-To's
GoAffPro Affiliate Portal
Getting Started for Affiliates
PointsKit: Rewards & Referrals
Powered By GitBook
CartX Integration
GoAffPro provides you with the option to integrate the CartX payment gateway.
To integrate the CartX payment gateway, embed the following code in the Body section of the Thank You page in the CartX app.
1
<script type="text/javascript">
2
(function () {
3
let q = [];
4
if(!window.Goaffpro){
5
window.Goaffpro = function(){
6
q.push(arguments);
7
}
8
}
9
var s = document.createElement('script');
10
s.type = 'text/javascript';
11
s.async = true;
12
s.src = 'https://static.goaffpro.com/client_sdk.js';
13
s.onload = ()=>q.forEach((item)=> Goaffpro.apply(null, item))
14
var x = document.getElementsByTagName('script')[0];
15
x.parentNode.insertBefore(s, x);
16
})();
17
Goaffpro('init', 'my-storefront-token');
18
Goaffpro('track-conversion', {
19
id: order.id,
20
number: order.name,
21
total_price: order.total_price,
22
subtotal_price: order.subtotal_price,
23
total_discounts: order.total_discounts,
24
email: order.email,
25
line_items: order.order_items.map(function(item){
26
return {
27
product_id: item.product_id,
28
variant_id: item.variant_id,
29
price: item.price,
30
quantity: item.quantity,
31
name: item.name,
32
total_discount: item.total_discount
33
}
34
})
35
});
36
</script>
Copied!
Replace the my-storefront-token with your store's public token.
To generate the storefront token, go to Settings > Advanced Settings tab > API/Access Token section.
Last modified 5mo ago
Copy link