Sending E-commerce event to Adoric

Learn how to send E-commerce event to Adoric

Want to know how much money each campaign generated?In order to analyze your campaigns in this way, you need to send it to Adoric e-commerce event. 

In the following example, you can view the E-commerce conversion rate, transactions, and revenue generated from a specific campaign, Learn more.
E-commerce

Ways of implementation: 

1. General (paste this code above </body>)

<script>
adoric.trigger('Purchase', {
value: PURCHASE-VALUE,
type: 'ecommerce'
})
</script>


*Note
: The value should be numeral. A decimal point can be used as a delimiter between the whole and fractional portions. (Examples: ‘199’; ‘120.99’; ‘12344.99’)

2. Send an event after page and Adoric code loaded (paste this code above </body>)

<script>
window.addEventListener('load', function () {
window.adoric && adoric.trigger('Purchase', {
value: 'PURCHASE-VALUE-HERE',
type: 'ecommerce'
})
});
</script>


3. Send an event after a click on a button

< button id="purchase">Purchase< /button>

< script>
document.getElementById("purchase").addEventListener("click", function( event ) {
// send E-commerce event
adoric.trigger('Purchase', {
value: 'PURCHASE-VALUE-HERE',
type: 'ecommerce'
})
}, false);
< /script>


Extra options:

Send event by submitting a form on Adoric Web message (paste this code above </body>)

<script>
window.adoric && window.adoric.on("form:after:submit", function (data) {
adoric.trigger('Purchase', {
value: 'PURCHASE-VALUE',
type: 'ecommerce'
})
});
<script>