How to track which storefront an order came from
Ecwid store can be easily installed at several sites at the same time. For example, you could add the storefront to your own site and to your blog page. Since all storefronts belong to your Ecwid store, all the orders will be listed on the My Sales → Orders page in your Ecwid admin. You can track which storefront an order came from to find out which site is more efficient.
Add special ID to the integration code
You can add your Ecwid store to any website using the integration code that you can copy from the Website page in your Ecwid admin. By adding the affiliate ID in this integration code, you can “mark” the storefront on the particular website. Worry not, you don’t have to be tech-savvy to do it.
The affiliate ID is basically a short line of code:
<script> xAffiliate("affiliate_id"); </script>
Instead of the “affiliate_id” you can add any word or phrase to mark the storefront. For example, you sell honey on Ecwid Instant Site, and honey-based cosmetic products on WordPress. You can mark the storefront on WordPress by adding the affiliate ID called “Honey cosmetics — WordPress”.
To do so, you should insert the following line:
<script> xAffiliate("affiliate_id"); </script>
between these lines of code:
<script type="text/javascript" src="http://app.ecwid.com/script.js?STORE_ID"
charset="utf-8"></script>
and
<script type="text/javascript"> xProductBrowser("categoriesPerRow=3",
"views=grid(3,3) list(10) table(20)","categoryView=grid","searchView=list","style=");
</script>
So as a result it may look like this:
<script type="text/javascript" src="http://app.ecwid.com/script.js?STORE_ID"
charset="utf-8"></script>
<script> xAffiliate("Honey cosmetics — WordPress"); </script>
<script type="text/javascript"> xProductBrowser("categoriesPerRow=3",
"views=grid(3,3) list(10) table(20)","categoryView=grid","searchView=list","style=");
</script>
Once you insert the code, all new orders from WordPress will be marked with the “Honey cosmetics — WordPress” line.
To add an affiliate ID to your store:
- From your Ecwid admin, go to Overview → Custom website → Copy code to clipboard. The integration code will be copied.
- Go to your website HTML-editor or ask your site programmer to insert the code.
- Add the <script> xAffiliate("affiliate_id"); </script> in the code you copied from your Ecwid admin like described above. Remember to change the “affiliate_id” with your word or phrase.
- From your Ecwid admin, go to Overview → Other platforms and sitebuilders → Copy code to clipboard. The integration code will be copied.
- From your Wix Dashboard, click Site actions in the right upper corner and select Edit site.
- In the Page dropdown in the top left corner, select the page with your Ecwid store.
- Click on the block with your store and click Settings.
- In the popup, go to Settings → Advanced settings and click here to add HTML code.
- Paste the integration code you copied from your Ecwid admin. Add the <script> xAffiliate("affiliate_id"); </script> in it like described above. Remember to change the “affiliate_id” for your word or phrase. For example, “Honey cosmetics — Wix”.
- Click Save.
- After you are done editing, click Publish to apply changes.
- From the WordPress Dashboard, go to Pages and select the page with your store.
- Click on the + icon to open the dropdown and click Browse all.
- Scroll down to Widgets and click Custom HTML.
- Paste the following code:
Remember to change the “your_affiliate_id_put_here” part with your word or phrase.<script> window.ec = window.ec || {}; ec.order = ec.order || {}; ec.order.extraFields = ec.order.extraFields || {}; ec.order.extraFields.affiliate = { 'title': 'Affiliate', 'value': "your_affiliate_id_put_here" }; window.Ecwid && Ecwid.refreshConfig(); </script>
- Click Publish to apply changes.
Now all new orders will be marked with affiliate ID.
Find out more about affiliate features in Ecwid →
Check where an order came from
After you add the affiliate ID to the integration code and insert it into your website, all new orders from the certain storefront will be marked with the phrase you chose. That way, you will know where the order came from. To check it out, go to Sales → Orders and select the order you want to check out. In the Additional information section, you will see the ID:
The IDs also appear in a CSV file when you export orders from your store. To see the IDs, you should choose the Affiliate ID column when exporting a CSV file. After exporting the CSV file, you can open it in the spreadsheet and compare the efficiency of different storefronts.
You can also obtain the IDs by means of our API. You can create a custom tool that will use Ecwid API for further processing of orders data, for example, for calculating revenue from each storefront.