Repository navigation
Expand file tree
/
Copy pathecommerce.html.md.erb
More file actions
86 lines (61 loc) · 3.36 KB
/
Copy pathecommerce.html.md.erb
File metadata and controls
86 lines (61 loc) · 3.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
---
parent: analytics
title: ecommerce
---
# Ecommerce <%= edit_link %>
Ecommerce tracking allows you to measure the transactions and revenue generated
from your e-shop.
You can track two types of ecommerce data:
Order
: A completed order - transaction
Item
: An item of a completed order - transaction
<%= partial 'partials/toc' %>
## Ecommerce
### addOrder
The `addOrder` command creates an Ecommerce order object.
##### Data Parameters
Name | Type | Required | Description
--------------- | ------ | -------- | -----------
`order_id` | String | Yes | The Order ID that was produced by your e-shop. It is used to uniquely identify the transaction.
`revenue` | String | Yes | The total revenue or grand total of the order. This value must include shipping and tax costs. Any additional payment cost should be excluded.
`shipping` | String | Yes | The total shipping cost of the order. Any additional payment cost should be excluded.
`tax` | String | Yes | The total tax of the order.
`paid_by` | String | No<b><sup>1</sup></b> | The payment method type of the order. The recommended payment method types are described in the table <%= link_to 'below', '', anchor: 'recommended-payment-method-types' %>.
`paid_by_descr` | String | No<b><sup>1</sup></b> | The description of payment method of the order that explains the payment method type (free text).
<small><b><sup>1</sup></b> Required for shops that have products in Technology categories</small><br />
> ##### Note
> Make sure **not** to include any cash on delivery (COD) costs in either `revenue` or `shipping`.
##### Recommended Payment Method Types
Type | Description (Examples)
---------------- | -----------
`bank_transfer` | Bank transfer
`cash_on_delivery` | Cash on delivery
`card` | Credit/Debit card
`paypal` | PayPal
`pay_in_store` | Pay in Store
`cryptocurrency` | Bitcoin, Etherium, etc.
> ##### Note
> Analytics can also accept payment method types that are not defined above, but ***IT IS NOT*** recommended.
##### Example
<%= render_code_from_file 'analytics/order_beacon' %>
> ##### Note
> The `paid_by` & `paid_by_descr` fields are required for shops that have products in Technology categories.
### addItem
The `addItem` command adds a new Ecommerce item object.
##### Data Parameters
Name | Type | Required | Description
------------- | ------ | -------- | -----------
`order_id` | String | Yes | The Order ID that was produced by your e-shop. This ID links items to their orders.
`product_id` | String | Yes | The [Unique ID](/products/xml_feed/#unique-id) from your e-shop.
`name` | String | Yes | The [name](/products/xml_feed/#name) of the product from your e-shop.
`price` | String | Yes | The individual, unit, final price for each item.
`quantity` | String | Yes | The number of units purchased in the order.
> ##### Note
> 1. As the `Product ID` you **must** provide the same [Unique ID](/products/xml_feed/#unique-id) that is
> submitted as part of the XML feedspec.
> 2. The `name` of the product **must** match the [Name](/products/xml_feed/#name) that is
> submitted as part of the XML feedspec.
> 3. Make sure your `Order ID` in your `addItem` command matches the one submitted by `addOrder`.
##### Example
<%= render_code_from_file 'analytics/item_beacon' %>