CheckoutChamp connects natively with several Ad tracking platforms, however you may find the need to run a script on your page which will grab order data from the session and send that data which can then be sent out to a 3rd party from the page itself.
The order’s session data will be stored within the orderData Object.
...
Here is an example script which will check the orderData Object for the order’s total amount:
Code Block |
---|
<script> var orderDataorderDataTmp = JSON.parse(sessionStorage.getItem("orderData")); if(orderDataorderDataTmp) { //fetch your needed values from orderDataTmp. Investigate orderData in session storage for all values. //Here are 2 examples //orderTotal: orderDataorderDataTmp.totalAmount //orderId: orderDataTmp.orderId } </script> |
The script above should be added to the top of the HTML in every page that your 3rd party tracking script has been added to.
The script provided by the 3rd party will likely contain some values that need to be replaced so that the proper value is sent out. Those values will need to be replaced with values that represent what the tracking platform is wanting to see. The value inserted should always start with “orderDataTmp.” and will finish with the name of the value found within the orderData Object.
If the tracking script wants you to include the orderId, you will want to replace the existing value in the script with orderDataTmp.orderId
If the tracking script wants you to include the orderTotal, you will want to replace the existing value in the script with orderDataTmp.totalAmount
Expand | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Expand | ||
---|---|---|
| ||
Open the Inspect Element tool and place a sale on your checkout page. Then, while still in the session, open the Application menu within the Inspect Element tool, open the Session storage for your site, and then click on orderData to reveal all the data that is available. |