You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/connections/destinations/catalog/actions-algolia-insights/index.md
+74-45Lines changed: 74 additions & 45 deletions
Original file line number
Diff line number
Diff line change
@@ -17,98 +17,127 @@ This destination is maintained by [Algolia](https://www.algolia.com/){:target="_
17
17
18
18
## Getting Started
19
19
20
-
1. From the Segment web app, click **Catalog**.
21
-
2. Search for "Algolia" in the Catalog, select it, and choose which of your sources to connect the destination to.
22
-
3. Enter the "App ID" & "API Key" into your Segment Settings UI which you can find on the Algolia Dashboard, under API Keys menu.
20
+
1. From the Destinations catalog page in the Segment App, click **Add Destination**.
21
+
2. Search for **Algolia** in the Destinations Catalog and select the **Algolia Insights (Actions)** destination.
22
+
3. Choose which Source should send data to the Algolia destination.
23
+
4. Sign in to the [Algolia dashboard](https://dashboard.algolia.com/users/sign_in) and retrieve your **App ID** and **API Key** for the application you'd like to connect. See **[Getting your Algolia credentials](#getting-your-algolia-credentials)** below for details on where to get these values.
24
+
5. Enter the **App ID** and **API Key** in the Algolia destination settings in Segment.
23
25
24
-
To find your App ID, there are two options. You can find the App Id in the Application dropdown in the Dashboard.
The other location is where you will also find your API Keys. You can find your API Keys in your settings under API Keys, you will need a Search API Key to set up the Destination in Segment.
28
+
Your app ID and API key can be found in the **API Keys** section of your account settings in the Algolia dashboard. You will need a **search** API key to set up the destination.
> The Algolia Insights Destination is not a plug-and-play integration. It requires you to modify your frontend code to end additional Algolia-related data like index name or queryID.
36
+
### Algolia-related data
37
+
38
+
The Algolia Insights Destination is not a plug-and-play integration. It requires you to modify your frontend code to add additional Algolia-related data like an index name and a query ID.
39
+
40
+
To access your query ID, make sure [`clickAnalytics`](https://www.algolia.com/doc/api-reference/api-parameters/clickAnalytics/) is enabled in your searches. If you're using our JavaScript search API client, this will look like:
38
41
39
-
To access your queryID, make sure clickAnalytics are enabled in your search event. If you're using Insights.js this will look like
40
42
```js
41
43
index.search('query', {
42
44
userToken:'user-1',
43
45
clickAnalytics:true
44
46
})
45
47
```
46
48
47
-
Once this is enabled you will be able to send properties like queryId in your segment events. You can read more about how to send Algolia-related data to Segment from [the documentation at Algolia](https://www.algolia.com/doc/guides/sending-events/implementing/connectors/segment/){:target="_blank”}.
49
+
Once this is enabled, you will be able to access `queryID`in your search response, which you can then use in your Segment events.
48
50
49
-
## Mapping Events
51
+
You can read more about how to send Algolia-related data to Segment in the [Algolia documentation](https://www.algolia.com/doc/guides/sending-events/connectors/segment/#augment-your-segment-events-with-algolia-related-data){:target="_blank”}.
50
52
51
-
By default, Algolia has set up mappings for Product Clicked, Product Viewed and Order Completed events. If your event structure doesn't match [Segments V2 Ecommerce Spec](/docs/connections/spec/ecommerce/v2/) you can update this by using the Mapping Tab.
53
+
## Mapping Events
52
54
53
-

55
+
By default, Algolia has set up mappings for `Product List Filtered`, `Product Clicked`, `Product Viewed`, `Product Added` and `Order Completed` events. If your event structure doesn't match Segment's [Ecommerce Spec](/docs/connections/spec/ecommerce/v2/), you can update this in the destination mappings section of the Segment app.
54
56
55
-

57
+

56
58
57
59
## Track
58
60
59
-
If you're not familiar with the Segment Specs, take a look to understand what the [Track method](/docs/connections/spec/track/) does.
61
+
If you're not familiar with the Segment spec, take a look to understand what the [Track](/docs/connections/spec/track/) method does.
60
62
61
-
Algolia supports the following events from Segment's [Ecommerce Spec](/docs/connections/spec/ecommerce/v2/).
63
+
Algolia supports the following Segment events out of the box:
62
64
63
65
<table>
64
66
<tr>
65
-
<td>Supported Events</td>
66
-
<td>Description</td>
67
+
<td>Supported Events</td>
68
+
<td>Description</td>
69
+
</tr>
70
+
<tr>
71
+
<td><code>Product List Filtered</code></td>
72
+
<td>Send this event when a visitor filters a product list or category.</td>
73
+
</tr>
74
+
<tr>
75
+
<td><code>Product Clicked</code></td>
76
+
<td>Fire this event when a visitor clicks a product.</td>
67
77
</tr>
68
78
<tr>
69
-
<td><code>Product Viewed</code></td>
70
-
<td>Fire this event when a visitor views a product.</td>
79
+
<td><code>Product Viewed</code></td>
80
+
<td>Fire this event when a visitor views a product.</td>
71
81
</tr>
72
82
<tr>
73
-
<td><code>Product Clicked</code></td>
74
-
<td>Fire this event when a visitor clicks a product.</td>
83
+
<td><code>Product Added</code></td>
84
+
<td>Fire this event when a visitor adds a product to their shopping cart.</td>
75
85
</tr>
76
86
<tr>
77
-
<td><code>Order Completed</code></td>
78
-
<td>Fire this event whenever an order/transaction was successfully completed by the customer.</td>
87
+
<td><code>Order Completed</code></td>
88
+
<td>Fire this event whenever an order/transaction was successfully completed by the customer.</td>
79
89
</tr>
80
90
</table>
81
91
82
-
For a full list of required properties for each event type, see the [Spec: V2 Ecommerce Events](/docs/connections/spec/ecommerce/v2/)
92
+
For a full list of required properties for each event type, see [Spec: V2 Ecommerce Events](/docs/connections/spec/ecommerce/v2/)
83
93
84
94
```js
85
-
analytics.track('Product Viewed', {
86
-
objectID:"hit objectID",
87
-
index:"my-index-name",
88
-
queryID:"Algolia queryID", // required only for Click Analytics,
89
-
// ... other required properties from the spec
95
+
analytics.track('Product List Filtered', {
96
+
search_index:"my-index-name",
97
+
filters: [
98
+
{
99
+
attribute:"color",
100
+
value:"yellow",
101
+
}
102
+
],
103
+
query_id:"Algolia queryID", // required only for Click Analytics,
104
+
// ... other required properties from the spec
90
105
})
91
106
92
107
analytics.track('Product Clicked', {
93
-
objectID:"hit objectID",
94
-
position: hitPositionOnIndex, // number
95
-
index:"my-index-name",
96
-
queryID:"Algolia queryID", // required only for Click Analytics,
97
-
// ... other required properties from the spec
108
+
search_index:"my-index-name",
109
+
product_id:"hit objectID",
110
+
position: hitPositionOnIndex, // number
111
+
query_id:"Algolia queryID", // required only for Click Analytics,
112
+
// ... other required properties from the spec
113
+
})
114
+
115
+
analytics.track('Product Viewed', {
116
+
search_index:"my-index-name",
117
+
product_id:"hit objectID",
118
+
query_id:"Algolia queryID", // required only for Click Analytics,
119
+
// ... other required properties from the spec
120
+
})
121
+
122
+
analytics.track('Product Added', {
123
+
search_index:"my-index-name",
124
+
product_id:"hit objectID",
125
+
query_id:"Algolia queryID", // required only for Click Analytics,
126
+
// ... other required properties from the spec
98
127
})
99
128
100
129
analytics.track('Order Completed', {
101
-
index:"my-index-name",
102
-
queryID:"Algolia queryID", // required only for Click Analytics,
103
-
products: [
104
-
{
105
-
objectID:"hit objectID",
106
-
// ... other required properties from the spec
107
-
},
130
+
search_index:"my-index-name",
131
+
products: [
132
+
{
133
+
product_id:"hit objectID",
134
+
queryID:"Algolia queryID",
108
135
// ...
109
-
]
136
+
},
137
+
// ... other required properties from the spec
138
+
]
110
139
})
111
140
```
112
141
113
142
> info ""
114
-
> If you send anonymous activity to Algolia, Algolia does not connect it to activity attributed to that same user once they are identified.
143
+
> If you send anonymous activity to Algolia, Algolia does not connect it to activity attributed to that same user once they are identified.
0 commit comments