edrone Integration

How it works

Edrone is a system for collecting and analyzing customer behaviour. Collected data and out-of-the-box engagement scenarios allow the system to increase customer retention.

Glossary

Site/Shop/Retailer/Company - e-commerce site that is integrated with edrone SaaS (e.g. online shoes shop).

Integration - process of setting up retailer's site to work with edrone. This includes registering an account, installing module and/or making server side changes on retailer's site, etc.

Custom Integration - integration that does not take advantage of available modules for e-commerce sites. It is typically required when the e-commerce platform does not offer sufficient extensibility mechanism (e.g. rendering custom JS scripts, access to data, etc.) or it is a custom-built store.

Module - package provided by edrone. It allow easy integration between e-commerce platform and edrone system. We provide modules for most of popular e-commerce platforms e.g. Magento, Prestashop, IAI, Shoplo, Shoper, Woocommerce, Shopify, Opencart etc.

Tracker - individual account in the edrone system.

  • Uniquely identified by App Id
  • Managed by Agents
  • It represents a shop in edrone

App Id - unique identifier for a tracker. It is inserted in the retailer's JavaScript tracking code and passed by customer browser (e.g. 53a97649ea0b3).

Onboarding - process of helping newly integrated shop owner to configure his account, design engagements, etc.

Mission Control - (https://control.edrone.me) administration panel for shop owners. It allows to manage Engagements, view reports, etc.

Customer - person who uses retailer services and has email address. Data generated by customers (visits, orders etc.) are collected and analyzed by edrone.

Agent - user that manages edrone Account. More than one agent can be associated with an account (i.e. Tracker).

Engagement - a process of encouraging somebody to return to the retailer site. It is typically a workflow consisting of multiple steps that has trigger conditions associated with them, e.g. RESTORE CUSTOMERS, RECOVER ABANDONED CARTS, etc.

Coupon - a code that allows user to obtain a discount. It is generated by retailer and uploaded to edrone. Coupons are included in the message and redeemed at retailer's site.

  • Static coupons - identical code is sent to all customers. The code is set in Mission Control.
  • Dynamic coupons - each customer receives unique code. Codes are generated by e-commerce platform and uploaded to edrone via Mission Control.

Drag&Drop editor - visual editor for creating HTML email templates based on dragging and dropping components (e.g. text blocks, placeholders, image elements)

HTML editor - visual editor for creating HTML code directly. Every email created in Drag’n’Drop editor can be edited in HTML editor. However, you cannot return to editing it in Drag’n’Drop editor after direct HTML modification.

Dynamic Placeholder - an element that can be added to email design. When email is sent to a specific Customer the placeholder is replaced with personalized image, text etc.

Spender - customer who made at least one order.

One-Time Spender - *spender8 who made exactly one order.

Repeat Spender - spender who made more than one order.

Inactive Customer - customer who has not visited the site for a specified period of time.

No Risk Inactive Customer - customer who has not visited the site [0, 7) days.

Low Risk Inactive Customer - customer who has not visited the site [7,30) days.

High Risk Inactive Customer - customer who has not visited the site for [30,∞) days

Spender Value - total value of orders made by a spender. Example: customer who made two orders 24$ and 36$ has a spender value of 60$

Low Spender Threshold - it is calculated so that the Low Spenders segment holds 80% of customers with the lowest total purchase value. Mathematically, it is the 80th percentile of spenders value. Separates Low Spenders from Medium Spenders.

Big Spender Threshold - it is calculated so that the Big Spenders segment holds 1% of customers with the highest total purchase value. Mathematically, it is the 99th percentile of spenders value. Separates Medium Spenders from Big Spenders.

Low Spender - spender whose value obtained by edrone algorithm is equal to or less than value of Low Spender Threshold. Typically Low Spenders group has many members.

Big Spender - spender whose value obtained by edrone algorithm is greater than Big Spender Threshold. Typically Big Spenders group has few members.

Medium Spender - spender whose value is between Low Spender and Medium Spender.

Frequent Spender - spender who is in top 25% who made the highest number of orders (order value is not considered here).

Trend Setter - customer who is active on Social Media.

Prospect - customer who has not made any order, yet (i.e. he is not a Spender).

Subscription Status - whether or not recipient wants to receive email

  • SUBSCRIBED
  • UNKNOWN - no information is available (e.g. it is not provided by e-commerce platform)
  • UNSUBSCRIBED

Double Opt-In - process of obtaining e-mail subscription consent. Upon entering email address recipient is sent an email containing unique subscription confirmation link. When the link is clicked the email address is marked as subscribed. This process can be implemented by the shop itself or by edrone using NEWSLETTER SUBSCRIPTION Engagement.

* Historical integrations may use OTHER for this interaction

Identifying Visitors

We use three methods of identifying visitors.

Field: "email" - if email field is passed in the event we use it as unique identifier of the customer. It applies to events originating from browser as well as server-side.

Field: "c_id" - this is a unique identifier generated by edrone JS script. It is stored in the browser local storage and passed in the event. If available we store mapping "c_id"-"email" so that we can uniquely identify customer based on "c_id" only in future events. It applies to events originating from browser only.

Cookie: "ccid" - this is a Third Party Cookie (Domain: "edrone.me") set by our system. It is automatically generated in response to the event set. If available we store mapping "ccid"-"email" so that we can uniquely identify customer based on "ccid" only in future events. It applies to events originating from browser only.

When system receives an event it evaluates what identifying information has been provided, existing mappings stored and makes an identity decision.

Event types

Trace - data describing customer interaction on the e-commerce site. We trace the following types of interactions:

  • PRODUCT_VIEW - customer viewed a product
  • ADD_TO_CART - customer added a product to the cart
  • ORDER - customer made an order
  • OTHER - other interaction (Automatically initialized when edrone_2_0.js is inserted in the <head> part of page.)
  • SUBSCRIBE - customer subscribe to newsletter form
  • ORDER_CANCEL - for instance, order was unpaid

Sending data to Edrone

E-commerce server generates JavaScript code which is returned to the end customer browser. In effect the end customer browser sends the data to Edrone servers.

Example JavaScript code:

<script type="text/javascript">
   (function (srcjs) {
       window._edrone = window._edrone || {};
       _edrone.app_id = '51a97611a3430';
       _edrone.version = '1.0.0';
       _edrone.platform_version = '1.2.9';
       _edrone.platform = 'custom';
       _edrone.email = 'test@example.org';
       _edrone.phone = '555-666-888';
       _edrone.first_name = 'John';
       _edrone.last_name = 'Smith';
       _edrone.product_skus = 'MAK03035';
       _edrone.product_ids = '3434';
       _edrone.product_titles = 'SANTI-DONNA';
       _edrone.product_images = 'http://x.z..com/media/s/x/cache/3/image/df/3/u/3u1a6597--1200q100.jpg';
       _edrone.product_availability = 1;
       _edrone.action_type = 'product_view';
       _edrone.country = 'UK';
       _edrone.city = 'London';

       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?app_id=51a97611a3430");
</script>


edrone_2_0.js - External JavaScript library provided by edrone.
Url: https://d3bo67muzbfgtl.cloudfront.net/edrone_2_0.js It should be initialized once using the following script

<script type="text/javascript">
   (function (srcjs) {
       window._edrone = window._edrone || {};

       _edrone.app_id = 'YOUR APP_ID';

       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?app_id=YOUR_APP_ID");
</script>


_edrone.init() - Function that is used to send data to edrone. It is automatically initialized after event "window.onload".

Example

<script>
$('#submit-button').on('click', function(){
    _edrone.customer_tags = 'From PopUp';
    _edrone.email = $('#input-email').val();
    _edrone.first_name = $('#input-name').val();
    _edrone.action_type = 'subscribe';
    _edrone.init();
});
</script>


Fields with multiple values Certain event types may require multiple values in the trace field. For example when an order event occurs the customer might have purchased multiple items.

In order to specify multiple values in a field separate them by pipe character (|)

Example

_edrone.product_skus = 'MAK03035|FE01041';


The following fields allow multiple values:

  • product_ids
  • product_titles
  • product_images
  • product_skus
  • product_urls
  • product_category_ids
  • product_category_names
  • customer_tags
  • product_counts
  • product_brand_ids
  • product_brand_names

A single product may belong to multiple categories (product_category_ids I product_category_names). In such case each category should be separated by ~ character.

Example

 _edrone.product_category_ids = '12~24~36';
 _edrone.product_category_names = 'Buty~Buty damskie~Szpilki';


Character encoding Any special characters (e.g. ",',<,>,&) should be encoded using url_encode function

Page Caching

Edrone JS code sends personal data (email, first name, last name, phone, city, country, etc.) to edrone servers. In order for the script to have access to personal data it is typically rendered in the page code, example:

window._edrone = window._edrone || {};
        _edrone.app_id = '789d7d6ddfdf';
        _edrone.version = '1.1.20';
        _edrone.platform = 'Magento';
        _edrone.platform_version = '1.8.0.2';
        _edrone.email = 'john@smith.org';
        _edrone.phone = '0123456789';
        _edrone.first_name = 'John';
        _edrone.last_name = 'Smith';


It is critical that e-commerce platform DOES NOT cache pages containing this data as it may inadvertently publicly show personal data belonging to other user.

Please make sure configuration of your caching mechanisms (full page caching, Varnish, etc.) takes into account the above.

Tags

Tags are used to associate additional information about a customer. This information may be later used in engagements.

Example


_edrone.customer_tags = 'gamer|Grand Theft Auto';


Before sending tags you must define them in edrone panel

Note: you can define maximum 64 Tags

Subscription

Choose from 4 different opt-in types in edrone panel.

Type Description
edrone double opt-in Double Opt-In provided by edrone.
non edrone double opt-in Double Opt-In provided by some other system or store.
single opt-in with message Single Opt-In with welcome message.
single opt-in Single Opt-In without welcome message.

Subscription - Use the subscribe action to send the information about customer subscription.

Example

<script>
$('#submit-button').on('click', function(){
    _edrone.customer_tags = 'From PopUp';
    _edrone.email = $('#input-email').val();
    _edrone.first_name = $('#input-name').val();
    _edrone.action_type = 'subscribe';
    _edrone.init();
});
</script>


  • $('#submit-button') - identifier of the subscription form button
  • $('#input-email').val(); - value of the email field
  • $('#input-name').val(); - value of the first name field

Subscription Status Reason

You can find customer subscription status reason in edrone panel on customer page.

ID Type Description
1 CUSTOMER_UNSUBSCRIBED Customer requested to be UNSUBSCRIBED by clicking on the "unsubscribe" link.
2 HARD_BOUNCED_UNSUBSCRIBED Recipient server returned SMTP code that was classified as HARD_BOUNCE, i.e. delivery to the target mailbox is permanently not possible. Typically happens when email address no longer exists or some other uncrecoverable error occurs. As a result customer is UNSUBSCRIBED.
3 CUSTOMER_SPAM_COMPLAINT_UNSUBSCRIBED Customer issued a spam complaint for the message.
4 AGENT_UNSUBSCRIBED Agent manually set the status (using Mission Control) to UNSUBSCRIBED.
5 EMAIL_INCORRECT_UNSUBSCRIBED Email address is incorrectly formatted and was UNSUBSCRIBED.
6 TRACE_UNSUBSCRIBED Trace which we received for the customer indicates the customer UNSUBSCRIBED.
7 DATA_IMPORT_UNSUBSCRIBED Customer was imported via CSV import and the value is UNSUBSCRIBED.
8 EXTERNAL_API_UNSUBSCRIBED Customer data received from External API (e.g. IAI API) indicates customer is UNSUBSCRIBED.
9 SPAM_BOUNCED_UNSUBSCRIBED Message for customer got rejected by the ESP with indication that it is spam. Customer was subsequently UNSUBSCRIBED.
10 TRACE_SUBSCRIBED Trace we received for the customer indicates the customer is SUBSCRIBED.
11 AGENT_SUBSCRIBED Agent manually set the status (using Mission Control) to SUBSCRIBED.
12 DATA_IMPORT_SUBSCRIBED Customer was imported via CSV import and the value is SUBSCRIBED.
13 TRACE_UNKNOWN Trace we received for the customer indicates the customer subscription status is UNKNOWN.
14 ENGAGEMENT_TEST_MESSAGE_UNKNOWN Engagement Test Message was sent to non-existing entity. In that case we create customer and set his status to UNKNOWN
15 SUBSCRIPTION_CHANGED_EVENT_SUBSCRIBED Customer set subscription by clicking "subscribe" link in the email.
16 EXTERNAL_API_SUBSCRIBED Customer data received from External API indicates customer is subscribed
17 EXTERNAL_API_UNKNOWN Customer data received from External API indicates customer is unknown
18 LEGACY_UNSUBSCRIBED Historical value not supported anymore.
19 CUSTOMER_DELETED_UNSUBSCRIBED Customer has been deleted
20 TOPIC_OBSERVE_UNKNOWN Email received from topic_observer where we don't have information about subscription status
21 DATA_IMPORT_UNKNOWN Customer was imported via CSV import and marked as unknown
22 SUPPORT_UNKNOWN Susbcription status was changed by internal support team.
23 SUPPORT_SUBSCRIBED Susbcription status was changed by internal support team.
24 SUPPORT_UNSUBSCRIBED Susbcription status was changed by internal support team.
25 CUSTOMER_RESUBSCRIBE Customer re-subscribed on the "Unsubscribe view"
26 LEGACY_SUBSCRIBED Historical value not supported anymore.
27 LEGACY_UNKNOWN Historical value not supported anymore.
28 SUBSCRIPTION_CHANGED_EVENT_UNSUBSCRIBED Customer unsubscribe by clicking "unsubscribe" link in the email.
29 DOUBLE_OPT_IN_NON_EDRONE_UNKNOWN Customer UNKNOWN by opt-in type.
30 DOUBLE_OPT_IN_EDRONE_UNKNOWN Customer UNKNOWN by opt-in type.
31 SINGLE_OPT_IN_SUBSCRIBED Customer SUBSCRIBED by opt-in type.
32 SINGLE_OPT_IN_WITH_MESSAGE_SUBSCRIBED Customer SUBSCRIBED by opt-in type.

Syncing subscription status webhook

edrone offers a mechanism to notify the e-commerce platform that customer subscription status has been changed. E-commerce platform needs to provide a HTTPS endpoint that will be automatically called upon subscription status change.

Example https://www.a_shop.com/update_subscriber_status

The following fields are sent (POST) to e-commerce platform.

NATIVE_3 (current)

Parameter name Description
email Customer email address
subscriber_status
    Email subscription status:
  • 0 - unsubscribed
  • 1 - subscribed
  • empty - information not available
event_date UTC date when the customer subscription status was changed.
event_id Unique event identifier
app_id Unique shop identifier - available in Mission Control (Settings > Integration)
signature HMAC that can be used by ecommerce platform to verify that the request is authentic. It uses a secret (app_secret) that is available in Mission Control (Settings > Integration)

Example (PHP)
$hash=hash("sha256",$email.$subscribeStatus.$eventDate.$eventId.$secret.$appId, false);
$signature = base64_encode($hash);

NATIVE_2 (deprecated)

Parameter name Description
email Customer email address
subscriber_status
    Email subscription status:
  • 0 - unsubscribed
  • 1 - subscribed
  • empty - information not available
event_date UTC date when the customer subscription status was changed.
event_id Unique event identifier
signature HMAC that can be used by ecommerce platform to verify that the request is authentic. It uses a secret (app_secret) that is available in Mission Control (Settings > Integration)

Example (PHP)
$hash=hash("sha256",$email.$subscribeStatus.$eventDate.$eventId.$secret, false);
$signature = base64_encode($hash);

NATIVE_1 (deprecated)

Parameter name Description
email Customer email address
signature HMAC that can be used by ecommerce platform to verify that the request is authentic. It uses a secret (app_secret) that is available in Mission Control (Settings > Integration)

Example (PHP)
$hash=hash("sha256",$email.$secret, false);
$signature = base64_encode($hash);

When is webhook invoked?

  • We can send notification on every subscription status change. This can be configured in Mission Control.
  • Currently we do not invoke the webhook when customers are manually imported via CSV file

To add subscription status endpoint, login to your Mission Control Panel then go to Settings and Platforms.

Wishlist

The WISHLIST engagement allows to send e-mail to all customers awaiting certain event (e.g. customer receives notification that shoe size he is waiting for is now available). In order to use it the e-commerce platform needs to send two additional events.

topic_observe
Url: https://api.edrone.me/topic_observe

Sent when customer observes an event (e.g. shoe size availability)

Field Description
app_id See Trace API below
email See Trace API below
topic_id Topic identifier is used to match topic_observe event with topic_publish event.
topic_campaign_id Campaign identifier of the observed topic. It can be viewed in Mission Control.

topic observe code exampleExample https://api.edrone.me/topic_observe?app_id=bdag3h3563u&email=przykladowyemail@gmail.com&topic_id=dg623be63bbs&topic_campaign_id=0

topic_publish
Trigger notification for all the customers observing the topic. Url: https://api.edrone.me/topic_publish

Value Description
app_id See Trace API below
topic_id Topic identifier is used to match topic_observe event with topic_publish event.
product_ids See Trace API below
product_urls CSee Trace API below
product_skus See Trace API below
product_titles See Trace API below
product_images See Trace API below
product_category_ids See Trace API below
product_category_names See Trace API below
product_brand_ids See Trace API below
product_brand_names See Trace API below

topic publish code example

Trace API

Parameter name Api Version Description
app_id 20150609 Application identifier. Uniquely identifies an e-commerce site. It is assigned by Edrone when new account is created. It must be set on the e-commerce site - typically by configuration screen.
c_id 20150609 Unique customer tracking identifier. Stored by customer browser. This field is automatically generated by edrone_2_0.js script.
version 20150609 Version of the module installed on the e-commerce site.
email 20150609 Customer email address
first_name 20150609 Customer first name
last_name 20150609 Customer last name
product_ids 20150609 Product identifiers for products that were viewed, added to cart or ordered. In case of Magento and Prestashop these are internal database product ids.
product_titles 20150609 Name of the product: viewed, added to cart or ordered by the customer.
product_images 20150609 Absolute urls to the images of the products viewed, added to cart or ordered by the customer.
order_id 20150609 Unique e-commerce site identifier of the order made by the customer.
action_type 20150609
    Type of action performed by customer:
  • product_view - individual product page
  • add_to_cart - added an item to the cart
  • order - customer has successfully completed and order
  • subscribe - subscription (typically pop-up)
  • order_cancel - customer order has been cancelled
  • other - none of the above
country 20150609 Customer country
city 20150609 Customer city
base_currency 20150619 Currency in which an e-commerce site operates. In case of e-commerce sites with multiple currencies this represents the main (global) currency.
order_currency 20150619 Currency in which the customer order has been made. It may be different from e-commerce site base currency.
base_payment_value 20150619 Total payment value of the order completed by the customer expressed in base_currency.
Mandatory field for Order events. Used a basis for all revenue calculations
order_payment_value 20150619 Total payment value of the order completed by the customer expressed in the order_currency. Used when e-commerce site allows purchasing products in various currencies.
phone 20150724 Customer phone number
coupon 20150724 Coupon used during order
platform_version 20150812 Version of the e-commerce platform (e.g. 1.9.2.1 for Magento)
product_skus 20150819 Product SKUs (stock keeping unit) for products that were viewed, added to cart or ordered.
platform 20151026 Name of the e-commerce platform (custom, magento, etc.)
subscriber_status 20151113
(20160531)
    Email subscription status:
  • 0 - unsubscribed
  • 1 - subscribed
  • empty - information not available
utc_time 20151113 UTC server time when snippet was generated.
product_urls 20160104 Absolute urls of the products,
product_category_ids 20160307 Category identifiers for each product in the trace. Many categories per product are allowed. Multiple entries are separated by "~" for one product then pipe character | to seperate with another product.
product_category_names 20160307 Category names for each product in the trace. Many categories per product are allowed. Multiple entries are separated by "~" for one product then pipe character | to seperate with another product.
product_brand_ids 20171010 Brand identifiers for each product in the trace. Only one brand per product is allowed. Multiple entries are separated by pipe character |
product_brand_names 20171010 Brand names for each product in the trace. Only one category per product is allowed. Multiple entries are separated by pipe character |
customer_tags 20160406 Tags to be associated with the customer. Multiple entries as separated by pipe character |
product_counts 20160831 Count of product. Multiple entries as separated by pipe character |
sender_type 20161201
    Indicates who is sending a trace
  • browser (default if absent)
  • server
shop_lang 20170127 Shop language version
shop_id 20170127 Identifier of the shop (used by Magento)
website_id 20170127 Shop website identifier (used by Magento)
product_availability 20180104
    Product availability status:
  • 1 - available
  • 0 - found but unavailable
  • -1 - not found
sms_subscriber_status 20180306
    SMS subscription status:
  • 0 - unsubscribed
  • 1 - subscribed
  • empty - information not available
event_utc_date 20180315 UTC server time when event has taken.

Trace API - Mandatory fields for all action types

Parameter name Trace Action Type
Other Product View Add To Cart Order Subscribe Order
Cancel
app_id M M M M M M
version M M M M M M
action_type M M M M M M
platform_version M M M M M M
platform M M M M M M
sender_type M M M M M M

Trace API - Mandatory fields for specific action types

Parameter name Action Type
Other Product View Add To Cart Order Subscribe Order
Cancel
email A A A M M M
first_name A A A M A
last_name A A A A A
product_ids M M M
product_titles M M M
product_images M M M
order_id M M
country A A A M A
city A A A M A
base_currency M
order_currency M
base_payment_value M
order_payment_value M
phone A A A A A
coupon A
product_skus M* M* M*
subscriber_status
sms_subscriber_status
product_urls M M M
product_category_ids M M M
product_category_names M M M
product_brand_ids A A A
product_brand_names A A A
customer_tags A A A A A
utc_time A A A A A
product_counts A M
shop_lang A A A A A A
shop_id A A A A A A
website_id A A A A A A
product_availability A A
event_utc_date

* - if there are no product_ids
M - mandatory field
A - optional field

JavaScript examples(browser)

Other


<script type="text/javascript">
       _edrone.app_id = '51a97611a3430';
       _edrone.version = '1.0.0';
       _edrone.action_type = 'other';
       _edrone.platform_version = '3.1.26';
       _edrone.platform = 'custom';
</script>


Product view


<script type="text/javascript">
       _edrone.app_id = '51a97611a3430';
       _edrone.version = '1.0.0';
       _edrone.action_type = 'product_view';
       _edrone.platform_version = '3.1.26';
       _edrone.platform = 'custom';
       _edrone.product_skus = 'NL1975286';
       _edrone.product_ids = '12';
       _edrone.product_titles = 'Sorel Women's shoes Glacy';
       _edrone.product_images = 'http://demo-store.edrone.me/img/p/4/5/45-large_default.jpg';
       _edrone.product_urls = 'http://demo-store.edrone.me/index.php?id_product=12&controller=product';
       _edrone.product_category_ids = '2~3~4';
       _edrone.product_category_names = 'Main~Shoes~Women's shoes';
       _edrone.product_availability = '1';
</script>


Add to cart


<script type="text/javascript">
       _edrone.app_id = '51a97611a3430';
       _edrone.version = '1.0.0';
       _edrone.action_type = 'add_to_cart';
       _edrone.platform_version = '3.1.26';
       _edrone.platform = 'custom';
       _edrone.product_skus = 'NL1975286';
       _edrone.product_ids = '12';
       _edrone.product_titles = 'Sorel Women shoes Glacy';
       _edrone.product_images = 'http://demo-store.edrone.me/img/p/4/5/45-large_default.jpg';
       _edrone.product_urls = 'http://demo-store.edrone.me/index.php?id_product=12&controller=product';
       _edrone.product_category_ids = '2~3~4';
       _edrone.product_category_names = 'Main~Shoes~Women shoes';
</script>

Order


<script type="text/javascript">
       _edrone.app_id = '51a97611a3430';
       _edrone.version = '1.0.0';
       _edrone.action_type = 'order';
       _edrone.platform_version = '3.1.26';
       _edrone.platform = 'custom';
       _edrone.email = 'john.doe@edrone.me';
       _edrone.first_name = 'John';
       _edrone.last_name = 'Doe';
       _edrone.subscriber_status = '1';
       _edrone.product_skus = 'NL1975286|NL2075286';
       _edrone.product_ids = '12|13';
       _edrone.product_titles = 'Sorel Women shoes Glacy|Sorel Women shoes Glacy Explorer Shortie';
       _edrone.product_images = 'http://demo-store.edrone.me/img/p/4/5/45-large_default.jpg|http://demo-store.edrone.me/img/p/4/7/47.jpg';
       _edrone.product_urls = 'http://demo-store.edrone.me/index.php?id_product=12&controller=product|http://demo-store.edrone.me/index.php?id_product=13&controller=product';
       _edrone.product_category_ids = '2~3~4|2~3~4';
       _edrone.product_category_names = 'Main~Shoes~Women shoes|Main~Shoes~Women shoes';
       _edrone.product_counts = '1|3';
       _edrone.order_id = '4321';
       _edrone.country = 'UK';
       _edrone.city = 'London';
       _edrone.base_currency = 'GBP';
       _edrone.order_currency = 'GBP';
       _edrone.base_payment_value = '671.50';
       _edrone.order_payment_value = '671.50';
</script>

Subscribe


<script type="text/javascript">
       _edrone.app_id = '51a97611a3430';
       _edrone.email = 'jonh.doe@edrone.me';
       _edrone.version = '1.0.0';
       _edrone.action_type = 'subscribe';
       _edrone.platform_version = '3.1.26';
       _edrone.platform = 'custom';
</script>



Data Import

Orders
To import historical orders use our endpoint "https://api.edrone.me/trace". Is important to fill "event_utc_date" field.


<?php

$history_orders = '[{
    "email": "johndoe@example.com",
    "event_date": "2018-03-12T08:04:46.241168Z",
    "first_name": "John",
    "last_name": "Doe",
    "phone": "123123123",
    "order_id": "19626",
    "city": "UK",
    "country": "London",
    "order_payment_value": "166.46",
    "order_currency": "GBP",
    "subscriber_status": "1",
    "customer_tags": ["tag1", "tag2"],
    "ordered_products": [{
        "product_id": "2356",
        "product_image": "https://example.com/img/product_media/2001-3000",
        "product_url": "https://www.example.com/plecaki/le-coq-sportif-plecak-classique-backpack",
        "product_title": "LeCoqSportifPlecakClassiqueBackpack",
        "quantity": "2",
        "product_categories": [{
            "name": "Accessories",
            "id": "227"
          },
          {
            "name": "Bags",
            "id": "331"
          }
        ]
      },
      {
        "product_id": "2339",
        "product_image": "https://example.com/img/product_media/2001-3001",
        "product_url": "https://www.example.com/portfele/le-coq-sportif-portfel-classique-wallet-2",
        "product_title": "LeCoqSportifPortfelClassiqueWallet",
        "quantity": "2",
        "product_categories": [{
            "name": "Accessories",
            "id": "227"
          },
          {
            "name": "Wallets",
            "id": "319"
          }
        ]
      },
      {
        "product_id": "20857",
        "product_image": "https://example.com/img/product_media/2001-3002",
        "product_url": "https://www.example.com/okulary-przeciwsloneczne/okulary-vans-spicoli-4-shade-white-rainbow-m",
        "product_title": "SunGlassesVansSpicoli4Shade",
        "quantity": "2",
        "product_categories": [{
            "name": "Accessories",
            "id": "227"
          },
          {
            "name": "Sun Glasses",
            "id": "328"
          }
        ]
      }
    ]
  },
  {
    "email": "alicebowman@example.com",
    "event_date": "2018-03-12T08:04:46.241168Z",
    "first_name": "Alice",
    "last_name": "Bowman",
    "phone": "123123123",
    "order_id": "19627",
    "city": "UK",
    "country": "London",
    "order_payment_value": "219.99",
    "order_currency": "GBP",
    "subscriber_status": "",
    "customer_tags": ["tag1", "tag2"],
    "ordered_products": [{
        "product_id": "18783",
        "product_image": "https://example.com/img/product_media/18001-19000",
        "product_url": "https://www.example.com/adidas-originals-2/buty-adidas-stan-smith-women-ftwr-white-2",
        "product_title": "Buty adidas Stan Smith Women",
        "quantity": "1",
        "product_categories": [{
            "name": "Shoes",
            "id": "225"
          },
          {
            "name": "Women",
            "id": "229"
          },
          {
            "name": "adidas originals",
            "id": "238"
          }
        ]
      }
    ]
  },
  {
    "email": "alicebowman@example.com",
    "event_date": "2018-03-12T08:04:46.241168Z",
    "first_name": "Alice",
    "last_name": "Bowman",
    "phone": "123123123",
    "order_id": "19627",
    "city": "London",
    "country": "UK",
    "order_payment_value": "244.98",
    "order_currency": "GBP",
    "subscriber_status": "",
    "customer_tags": ["tag1", "tag2"],
    "ordered_products": [{
        "product_id": "18261",
        "product_image": "https://example.com/img/product_media/18001-19001",
        "product_url": "https://www.example.com/adidas-originals/buty-adidas-la-trainer-og-collegiate-green",
        "product_title": "adidas LA TRAINER OG",
        "quantity": "2",
        "product_categories": [{
            "name": "Shoes",
            "id": "225"
          },
          {
            "name": "Men",
            "id": "228"
          },
          {
            "name": "adidas originals",
            "id": "237"
          }
        ]
      }
    ]
  }]';

function utcNow() {
    $t = microtime(true);
    $micro = sprintf("%03d", ($t - floor($t)) * 1000000);
    return gmdate('Y-m-d\TH:i:s.', $t) . $micro . 'Z';
  }

function prepTrace($order) {
    $products = $order->ordered_products;
    $product_ids = [];
    $product_titles = [];
    $product_counts = [];
    $product_urls = [];
    $product_images = [];
    $product_category_ids = [];
    $product_category_names = [];

    foreach ($products as $product) {
        $single_product_category_ids = [];
        $single_product_category_names = [];
        foreach($product->product_categories as $category){
          array_push($single_product_category_ids, $category->id);
          array_push($single_product_category_names, $category->name);
        }

        array_push($product_ids, $product->product_id);
        array_push($product_titles, $product->product_title);
        array_push($product_urls, $product->product_url);
        array_push($product_counts, $product->quantity);
        array_push($product_images, $product->product_image);
        array_push($product_category_ids,  join('~', $single_product_category_ids));
        array_push($product_category_names,  join('~', $single_product_category_names));


    }

    $edroneData = 'version=' . '1.0.0' .
            '&app_id=' . 'YOUR_APP_ID' .
            '&email=' . $order->email .
            '&first_name=' . $order->first_name .
            '&last_name=' . $order->last_name .
            '&product_ids=' . join('|', $product_ids) .
            '&product_titles=' . join('|', $product_titles) .
            '&product_images=' . join('|', $product_images) .
            '&product_urls=' . join('|', $product_urls) .
            '&product_counts=' . join('|', $product_counts) .
            '&product_category_ids=' . join('|', $product_category_ids) .
            '&product_category_names=' . join('|', $product_category_names) .
            '&order_id=' . $order->order_id .
            '&order_payment_value=' . $order->order_payment_value .
            '&base_payment_value=' . $order->order_payment_value .
            '&sender_type=' . 'server' .
            '&base_currency=' . $order->order_currency .
            '&order_currency=' . $order->order_currency .
            '&action_type=' . 'order' .
            '&country=' . $order->country .
            '&city=' . $order->city .
            '&phone=' . $order->phone .
            '&customer_tags=' . join('|', $order->customer_tags) .
            '&subscriber_status=' . '' .
            '&event_utc_date=' . $order->event_date .
            '&utc_time=' . utcNow();
    return $edroneData;
}

function httpPost($url, $params) {
  $curl = curl_init();

  curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_POSTFIELDS => $params,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    // CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
      "cache-control: no-cache",
      "content-type: application/x-www-form-urlencoded"
    ),
  ));

  $response = curl_exec($curl);
  $err = curl_error($curl);

  curl_close($curl);

  if ($err) {
    echo "cURL Error #:" . $err;
  } else {
    echo $response;
  }
}

foreach (json_decode($history_orders) as $order) {
    httpPost('https://api.edrone.me/trace', prepTrace($order));
}



PHP examples(server)

Order cancel
The "order_cancel" event allows marking orders in edrone CRM system as deleted.


<?php
  function orderCancel(){
    $edroneData = 'version=' . '1.0.0' .
       '&app_id=' . 'YOUR APP ID' .
       '&email=' . 'email@example.pl' .
       '&order_id=' . '00001' .
       '&action_type=' . 'order_cancel' .
       '&sender_type=' . 'server';
       return $edroneData;
    }

  function httpPost($url, $params) {
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($ch, CURLOPT_HEADER, false);
     curl_setopt($ch, CURLOPT_POST, count($params));
     curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
     $output = curl_exec($ch);
     curl_close($ch);
     return $output;
  }
  httpPost('https://api.edrone.me/trace', orderCancel());


Trace Monitor

Tool is available in edrone panel after login(control.edrone.me). Choose from menu "Settings" -> "Integrations" -> "Trace Monitor". To start, please press button "Clear session and start collecting new data".

Trace monitor is responsible for collecting information about traces which come from your store, analyzing and picking up error and warnings.


Push Domain Configuration

Default push domain is a subdomain of edrone.me, unique to each client e.g. 55e01cbdc61f8.edrone.me

Edrone clients have two options to change it:

  1. First option is to change the subdomain part only, e.g 55e01cbdc61f8.edrone.me -> mystore.edrone.me. In this case we do not require additional configuration on client side, please contact our support to set it up.
  2. Second option is to change the whole domain name, e.g. 55e01cbdc61f8.edrone.me -> push.mystore.com. To make it work we require valid SSL certificate issued for the subdomain, i.e. push.mystore.com. Certificate key length can not be longer then 2048 bits (e.g. 4096 bits will not currently work). After receiving proper certificate from you we generete you a unique "URL ADDRESS" which must be added to your DNS records:
    Name: push.mystore.com
    Type: CNAME
    Value: URL ADDRESS


Cookies set by edrone

Name Domain Usage Expiry Set By HttpOnly Secure
ccid edrone.me, api.edrone.me Unique visitor identifier. 100 years Server (trace, open, email_click, push_token_query) No No
e_dv_$(app_id) api.edrone.me Used to calculate unique daily visitors statistic. Only presence counts (value is discarded). Daily at midnight UTC Server (trace) Yes (since 2017/07/11) Yes (since 2017/07/11)
edrone_popup shop Used to manage state of the pop-up (how often it should be displayed) Custom (shop decides) Javascript No No
edrone_push_widget shop Used to manage state of the push widget. It works as a snooze button, i.e. if widget is configured to auto-open, it says how long it should stay closed after user clicks “Close”. 24 hours Javascript No No
push_action_type_$(url) *.edrone.me Used to cache subscription state for the push notifications (register/deregister) 1 hour Server Yes (since 2017/07/11) Yes (since 2017/07/11)
PHPSESSID control.edrone.me, admin.edrone.me Session identifier for the PHP application (Mission Control and Admin). Session Server (Mission Control, Admin) Yes (since 2017/07/01) Yes (since 2017/07/01)

Local storage variables set by edrone

Name Usage Expiry Notes
cId Unique user identifier. Not a real HTTP cookie but works just like First Party cookie. - Local storage variables are set independently for HTTP and HTTPS under a shop domain. This acts akin to First Party cookie. Historically it was the first mechanism used by clients.
recommended_data Include user actions history(represented as JSON format), based on edrone API's events. - -

Cookies set by other companies

Name Type Domain Usage Expiry Set By
AWSELB Cookie (3rd party) *.edrone.me Assigned by ELB for load balancing purposes. Session ELB
_ga* Cookie (1st Party) edrone.me Google Analytics Per Google policy Javascript
intercom-id-* Cookie (1st Party) edrone.me, control.edrone.me Intercom Per Google policy Javascript

When we will not show PopUp again to the same customer?

Scenario 1:

  • Popup is displayed to customer
  • Customer performs interactions (subscribes to newsletter or closes popup)
  • Afterwards we mark customer with edrone_popup cookie, which TTL (time to live) is set in the exit-popup settings Popup display frequency settings
  • Popup will not be displayed to this customer again - as long as edrone_popup cookie will be present

    Scenario 2:

  • If all of Below conditions are true
    • user is logged in
    • user has subscribed to newsletter status in the shop
      • that might be achived by:
        • agreeing to newsletter during account creation
        • changing that status in shop user settings
        • Subscribing to edrone newsletter, when shop has active syncing subscription status
      • platform sends current subscription status in trace (currently supported in Magento1, Magento2, Shopify)
  • In this case user is marked with cookie edrone_subsribed with TTL set to 100 days
  • Popup will not be displayed to this customer again - as long as edrone_subsribed cookie will be present

Other information

Google Tag Manager
Currently not supporting

In case implementing edrone integration on test enviroment, after publishing integration to production create new edrone account and use new app_id.

Log in

Log in Forgot password? ×

edrone 30 days free trial

no credit card required

Join us Forgot password? ×