Get help with Shoplo products

Edrone Integration



Integration for the first time

  1. Go to Layout >3 dots > HTML Editor in the store dashboard.
  2. Click on  Layout>base.tpl and choosebase.tpland before closing </head>

    paste the code below:

    <!-- START EDRONE HEADER -->
    <!--
    * GPL license.
    * https://edrone.me/integration-license/
    -->
    <script>
    {if $customer->email}
    window._edrone = window._edrone || {};
    _edrone.email = '{$customer->email}';
    _edrone.first_name = '{$customer->first_name}';
    _edrone.last_name = '{$customer->last_name}';
    {/if}
    </script>
    <!-- END EDRONE HEADER -->

    Then save your changes.

  3. Go to Settings > Conversion and tracking. In Additional code – ‘Body’ section paste the code below:
    <!--* GPL license.* https://edrone.me/integration-license/-->
    <script>
    (function(srcjs) {
    window._edrone = window._edrone || {};
    _edrone.app_id = "your_id";
    _edrone.version = "1.0.8";
    _edrone.platform = "shoplo";var pageProduct = document.querySelector('#page-product')
    if (pageProduct) {
    window._edrone_send_handler = function () {
    _edrone.first_run = false;
    var productName = window.location.pathname.split('/').pop();
    fetch(window.location.origin + '/products/' + productName + '.js')
    .then(function (response) {
    return response.json();
    }).then(function (data) {
    _edrone.product_ids = data.id;
    _edrone.product_titles = data.title;
    _edrone.product_images = data.main_image;
    _edrone.product_urls = window.location.href;
    _edrone.product_category_ids = data.categories.join('|');
    _edrone.product_category_names = data.categories.join('|');
    _edrone.action_type = 'product_view';
    _edrone.init();});
    $(document).ready(function () {
    jQuery("[name=addToCard] , [name='addToCart']").click(function () {
    _edrone.action_type = 'add_to_cart';
    _edrone.init();
    });
    });
    }
    }var doc = document.createElement('script');
    doc.type = 'text/javascript';
    doc.async = true;
    doc.src = ('https:' == document.location.protocol
    ? 'https:'
    : 'http:') + srcjs;
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(doc, s);
    })("//d3bo67muzbfgtl.cloudfront.net/edrone_2_0.js");
    </script>

    Instead of your_id, enter the App ID from Edrone.

  4. In box Additional content and scripts within the ‘Thank You’ page, paste the code below:
<!--* GPL license.* https://edrone.me/integration-license/-->
<script>
(function (srcjs) {
window._edrone = window._edrone || {};
var _shoplo_edrone = {};
{/literal}
_shoplo_edrone.titles = [{foreach from=$items item=line_item}'{$line_item->title|escape:'url'}',{/foreach}];
_shoplo_edrone.products_ids = [{foreach from=$items item=line_item}'{$line_item->product_id}',{/foreach}];
_shoplo_edrone.products_images = [{foreach from=$items item=line_item}'{$line_item->product->main_image|product_img_url:th1024}',{/foreach}];
_shoplo_edrone.products_urls = [{foreach from=$items item=line_item}'{$shop->domain}/{$line_item->product->url}',{/foreach}];
_shoplo_edrone.products_counts = [{foreach from=$items item=line_item}'{$line_item->quantity}',{/foreach}];
{literal}
_edrone.app_id = 'your_id';
_edrone.platform = 'shoplo';
_edrone.version = '1.0.8';
_edrone.email = '{client_email}';
_edrone.first_name = '{client_first_name}';
_edrone.last_name = '{client_last_name}';
_edrone.subscriber_status = '{client_accept_newsletter}';
_edrone.action_type = 'order';
_edrone.product_titles = _shoplo_edrone.titles.join('|');
_edrone.product_images = _shoplo_edrone.products_images.join('|');
_edrone.product_ids = _shoplo_edrone.products_ids.join('|');
_edrone.product_urls = _shoplo_edrone.products_urls.join('|');
_edrone.order_id = '{order_id}';
_edrone.country = '{client_country}';
_edrone.city = '{client_city}';
_edrone.phone = '{client_phone}';
_edrone.base_currency = '{shop_currency}';
_edrone.order_currency = '{shop_currency}';
_edrone.base_payment_value = '{sum}';
_edrone.order_payment_value = '{sum}';
_edrone.coupon = '{discount_code}';
var doc = document.createElement('script');
doc.type = 'text/javascript';
doc.async = true;
doc.src = ('https:' == document.location.protocol ? 'https:' : 'http:') + srcjs;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(doc, s);
})("//d3bo67muzbfgtl.cloudfront.net/edrone_2_0.js");
</script>

Instead of your_id, enter the App ID from Edrone.


If your store already has integration.

Remove Edrone integration codes added in Layout> HTML editor from files: base.tpl, product.tpl and from the tab Settings > Conversion and tracking >Additional code – ‘Body’ section

Then re-implement the integration according to the instructions above.

Was this article helpful?

Team