Skip to content

Commit 366fd29

Browse files
authored
Merge pull request #6808 from algolia/algolia/update
Update Algolia Insights Destination
2 parents 110929b + 36c9b07 commit 366fd29

File tree

7 files changed

+74
-45
lines changed

7 files changed

+74
-45
lines changed
Loading

src/connections/destinations/catalog/actions-algolia-insights/index.md

Lines changed: 74 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -17,98 +17,127 @@ This destination is maintained by [Algolia](https://www.algolia.com/){:target="_
1717

1818
## Getting Started
1919

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.
2325

24-
To find your App ID, there are two options. You can find the App Id in the Application dropdown in the Dashboard.
26+
### Getting your Algolia credentials
2527

26-
![Application Dropdown](images/algolia_app_id_dropdown.png)
27-
28-
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.
2929

3030
![Dashboard Settings](images/algolia_dashboard_settings.png)
3131

3232
![Settings Menu](images/algolia_settings_menu.png)
3333

3434
![Api Keys](images/algolia_api_keys.png)
3535

36-
> info ""
37-
> 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:
3841

39-
To access your queryID, make sure clickAnalytics are enabled in your search event. If you're using Insights.js this will look like
4042
```js
4143
index.search('query', {
4244
userToken: 'user-1',
4345
clickAnalytics: true
4446
})
4547
```
4648

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.
4850

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”}.
5052

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
5254

53-
![Mappings Tab](images/mapping_tab.png)
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.
5456

55-
![Edit Mappings](images/mapping_tab_edit.png)
57+
![Mappings Tab](images/mappings_tab.png)
5658

5759
## Track
5860

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.
6062

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:
6264

6365
<table>
6466
<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>
6777
</tr>
6878
<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>
7181
</tr>
7282
<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>
7585
</tr>
7686
<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>
7989
</tr>
8090
</table>
8191

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/)
8393

8494
```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
90105
})
91106

92107
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
98127
})
99128

100129
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",
108135
// ...
109-
]
136+
},
137+
// ... other required properties from the spec
138+
]
110139
})
111140
```
112141

113142
> 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

Comments
 (0)