Magento is an open-source e-commerce platform written in PHP. Scaleo provides the ability to create the affiliate network for your Magento store and gives your affiliates all the tools to promote the products effectively.
Setting Up The Tracking
- Create an Offer the regular way in Scaleo.
- Select that Offer, go to Goals. Select Edit a Goal and scroll to Tracking Methods section.
- Select: Tracking Method > IMG Pixel. Copy that code.
- Magento doesn't give the ability to enter tracking pixel via interface settings, so we need to edit the code manually to the Thank You page.
- for CPA goal (pass Order ID):
<img src="https://yourcompany.scaletrk.com/track?goal_id=XXX&adv_order_id=<?php echo $order->id; ?>" height="1" width="1" />
- for CPS goal (pass Order Amount and Order ID, only works with Magento 2.3.5 or higher):
<img src="https://yourcompany.scaletrk.com/track?goal_id=XXX&amount=<?php echo ($order->order_total - $order->order_shipping); ?>&adv_order_id=<?php echo $order->id; ?>" height="1" width="1" />
Note: Please make sure you change your Scaleo platform URL and Goal ID. You can also remove
goal_idparameter entirely if you have just one Goal or you want default Goal to be converted.
// This will get order ID $lid = $this->getOrderId(); echo "Order ID:".$lid."<br/>"; // Get order Instance $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $order = $objectManager->create('Magento\Sales\Model\Order')->load($lid); // Order Total amount $total = $order->getGrandTotal(); echo "Order Total:".$total."<br/>"; // Try to print $order object to get your relevant data and then put it in iframe Like below ?> <img src="https:/yourcompany.scaletrk.com/track?goal_id=8&amount=<?php echo ($total); ?>&adv_order_id=<?php echo $lid; ?>" height="1" width="1" />
Everything is set now. Affiliate can use Offer Tracking Link to drive the traffic to your Magento store. Once the order will be placed, we will get the conversion into Scaleo platform and Affiliate will be credited.