GTM Live Streaming Instructions
- Go to your Google Tag Manager and select "Tags" section to create a new tag. Click "New".
- Look for the “Immerss Live” tag and select it.
- Select or create a trigger for the page where the player will be placed.
- Go to your Immerss back office and select Streaming > Channels > “Any channel” and copy “GTM player code”.
- Paste the copied code from the previous step on the page for which the trigger was created.
- Save the tag and publish.
GTM Tracking Order Instructions
- Go to Immerss back office and select Settings > Store and copy the Application ID.
- Now go to your Google Tag Manager account in the Tags section and create a new tag. Click "New".
- Look for the “Immerss Tracking Order” tag and select it.
- Enter "Application ID" which was copied from the back office.
- Select or create a trigger to display only on the order completion page.
- Adding a script on the order completion page:
<script type="text/javascript"> function imrsTrackingOrderLoaded() { var imrs = new Imrs(); imrs.addOrderItem(‘{item_id}’, {item_quantity}, {item_amount}, {item_discount}); imrs.save('{order_id}'); } </script>
{order_id} (string) Created Order ID
{item_id} (string) Order item ID
{item_quantity} (integer) quantity in item
{item_amount} (float) price of 1 item excluding delivery, taxes and discounts
{item_discount} (float) discount for 1 item
Woocommerce example:<script type="text/javascript"> function imrsTrackingOrderLoaded() { var imrs = new Imrs(); <?php foreach($order->get_items(array("line_item")) as $order_item_id => $order_item): ?> imrs.addOrderItem("<?php echo $order_item_id ?>", <?php echo $order_item->get_quantity() ?>, <?php echo floatval($order_item->get_product()->get_price()) ?>, 0); <?php endforeach; ?> imrs.save("<?php echo $order->get_id() ?>"); } </script>
Magento 2 example:<script type="text/javascript"> function imrsTrackingOrderLoaded() { var imrs = new Imrs(); <?php foreach($order->getAllVisibleItems() as $order_item): ?> imrs.addOrderItem("<?php echo $order_item->getId() ?>", <?php echo intval($order_item->getQtyOrdered()) ?>, <?php echo $order_item->getOriginalPrice() ?>, <?php echo $order_item->getBaseDiscountAmount() ?>); <?php endforeach; ?> imrs.save("<?php echo $order->getId(); ?>"); } </script>
- Save the tag and publish
GTM Visitor Tracking Instructions
- Go to Immerss back office and select Settings > Store, and copy the Application ID.
- Go to your Google Tag Manager account - Tags section and create a new tag. Click "New".
- Look for the “Immerss Tracking Visit” tag and select it.
- Enter "Application ID" which was copied from the back office.
- Select or create a trigger to display on all pages of the site.
- Save and publish.
GTM Widget Instructions
- Go to Immerss back office and select Settings > Store, and copy the Application ID.
- Go to your Google Tag Manager - Tags section and create a new tag. Click "New".
- Look for the “Immerss Widget” tag and select it.
- Enter "Application ID" which was copied from the back office.
- Select or create a trigger to display on all pages of the site.
- Adding a script to all pages of the site.
<script type=”text/javascript”> function imrsWidgetLoaded() { window.Immerss.listViewed = [“12121324334”]; // array of viewed products window.Immerss.listWish = [“1232434354”]; // array of selected products window.Immerss.listBag = [{id: 41953783939241, quantity: 1}]; // array of items in the cart } </script>
- Save the tag and publish.