Skip to content

Commit 3cd98d6

Browse files
author
sanscontext
committed
Additions to the Amplitude Actions doc
1 parent ee4c45a commit 3cd98d6

File tree

2 files changed

+184
-2
lines changed

2 files changed

+184
-2
lines changed
145 KB
Loading

src/connections/destinations/catalog/actions-amplitude/index.md

Lines changed: 184 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
2-
title: Amplitude Actions Destination
2+
title: Amplitude (Actions) Destination
33
hide-boilerplate: true
44
hide-dossier: true
55
hidden: true
66
---
7+
78
{% include content/plan-grid.md name="actions" %}
89

910

@@ -21,7 +22,7 @@ and conversion.
2122
> **Good to know**: This page is about the [Actions-framework](/docs/connections/destinations/actions/) Amplitude Segment destination, which receives data _from_ Segment. There's also a page about the [non-Actions Amplitude destination](/docs/connections/destinations/catalog/amplitude/), and the [Amplitude Engage Segment source](/docs/connections/sources/catalog/cloud-apps/amplitude-cohorts/), which sends data _to_ Segment!
2223
2324

24-
## Connection Modes for Amplitude Actions destination
25+
## Connection Modes for Amplitude (Actions) destination
2526

2627
The Amplitude (actions) destination does not offer a device-mode connection mode. However if you are using one of Segment's new libraries ([Analytics.js 2.0](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/), [Swift](https://github.com/segmentio/analytics-swift) or [Kotlin](https://github.com/segmentio/analytics-kotlin)) with the Actions-framework version of the destination, you do not need the device-mode connection.
2728

@@ -70,3 +71,184 @@ To enable session tracking in Amplitude when using the [Segment Kotlin library](
7071
```kotlin
7172
analytics.add(AmplitudeSession())
7273
```
74+
75+
76+
## Available Amplitude Actions
77+
78+
Amplitude supports the following Actions:
79+
80+
- Log Event
81+
- Identify User
82+
- Map User
83+
- Group Identify User
84+
85+
You can see the Segment event fields Amplitude accepts for each action in the Actions subscription set up page.
86+
87+
88+
## Quick set-up actions
89+
90+
By default a new Amplitude (Actions) destination comes with the following subscriptions.
91+
92+
You can select these subscriptions by choosing “Quick Setup”. You can enable, edit, and disable them from the screen that appears.
93+
94+
| Subscription Name | Trigger | Amplitude Action | Non-default mapped fields |
95+
| ----------------- | ------------------------------------------------ | ---------------- | -------------------------------------------------------------- |
96+
| Track Calls | All **track** calls from the connected source | Log Event | Event Type = `event`<br>for example, `Order Completed` |
97+
| Page Calls | All **page** calls from the connected source | Log Event | Event Type = Viewed `name`<br>for example, `Viewed Homepage` |
98+
| Screen Calls | All **screen** calls from the connected source | Log Event | Event Type = Viewed `name`<br>for example, `Viewed Homescreen` |
99+
| Identify Calls | All **identify** calls from the connected source | Identify User | |
100+
101+
![](images/actions-amplitude-defaults)
102+
103+
104+
105+
## Amplitude’s Log Event Action
106+
107+
Segment sends an event to Amplitude.
108+
Default trigger:
109+
110+
- Event Type is Track
111+
112+
### Order Completed
113+
114+
Use the [Order Completed](/docs/connections/spec/ecommerce/v2/#order-completed) event to track revenue with Amplitude. This event records a list of products that a user purchased in a single transaction. This is the best way for sites that have a shopping cart system to track purchases.
115+
116+
You can currently use this event only for data coming from a server or web [source](/docs/connections/sources/). An `Order Completed` event from mobile using our bundled Amplitude integration will work the same as our standard `track` event documented above.
117+
118+
The example below shows an “Order Completed” event with its properties.
119+
120+
```js
121+
analytics.track({
122+
"userId": "e953c39d2597f0b8a79dd3c407baeb13bb58523a",
123+
"event": "Order Completed",
124+
"properties": {
125+
"checkoutId": "6727142daf49b93a601d3a31bc3d53aeae1d15ab",
126+
"orderId": "50314b8e9bcf000000000000",
127+
"affiliation": "Google Store",
128+
"total": 30,
129+
"revenue": 25,
130+
"shipping": 3,
131+
"tax": 2,
132+
"discount": 2.5,
133+
"coupon": "hasbros",
134+
"currency": "USD",
135+
"products": [
136+
{
137+
"productId": "507f1f77bcf86cd799439011",
138+
"sku": "45790-32",
139+
"name": "Monopoly: 3rd Edition",
140+
"price": 19,
141+
"quantity": 1,
142+
"category": "Games"
143+
},
144+
{
145+
"productId": "505bd76785ebb509fc183733",
146+
"sku": "46493-32",
147+
"name": "Uno Card Game",
148+
"price": 3,
149+
"quantity": 2,
150+
"category": "Games"
151+
}
152+
]
153+
}
154+
})
155+
```
156+
157+
When you send an “Order Completed” event from Segment, an “Order Completed” event appears in Amplitude for that purchase. An Amplitude event called “Product Purchased” is also created for each product in the purchase. All event properties, except `products`, are sent as `event_properties` of the Amplitude “Order Completed” event. Information about each product is present *only* on the individual “Product Purchased” events.
158+
159+
### Track Revenue Per Product
160+
161+
Amplitude has two different ways to track revenue associated with a multi-product purchase. You can choose which method you want to use using the **Track Revenue Per Product** destination setting.
162+
163+
If you disable the setting (“off”), Segment sends a single revenue event with the total amount purchased. Revenue data is added to the Amplitude “Order Completed” event. The “Product Purchased” events do not contain any native Amplitude revenue data.
164+
165+
If you enable the setting (“on”), Segment sends a single revenue event for each product that was purchased. Revenue data is added to each “Product Purchased” event, and the “Order Completed” event does not contain any native Amplitude revenue data.
166+
167+
Make sure you format your events using the [Track method spec](/docs/connections/spec/track/). You must pass a `revenue` property, a `price` property, and a `quantity` property for each product in the products list.
168+
169+
### Send To Batch Endpoint
170+
171+
> info “”
172+
> This endpoint is available when you send data in Cloud-mode only.
173+
174+
If `true`, events are sent to Amplitude’s `batch` endpoint rather than to their `httpapi` endpoint. Because Amplitude’s `batch` endpoint throttles traffic less restrictively than the Amplitude `httpapi` endpoint, enabling this setting can help to reduce 429 errors (throttling errors) from Amplitude.
175+
176+
Amplitude’s `batch` endpoint throttles data when the rate of events sharing the same `user_id` or `device_id` exceeds an average of 1,000/second over a 30-second period. See the Amplitude documentation for more about [429 errors and throttling in Amplitude](https://developers.amplitude.com/#429s-in-depth).
177+
178+
## Identify User
179+
180+
In the default configuration, this mapping is triggered when Segment sends an Identify call to Amplitude (Actions).
181+
182+
Set the user ID for a specific device ID or update user properties without sending an event to Amplitude.
183+
184+
185+
## Map User
186+
187+
In the default configuration, this mapping is triggered when Segment sends an Alias call to Amplitude (Actions).
188+
189+
Merge two users together that would otherwise have different User IDs tracked in Amplitude.
190+
191+
192+
## Group Identify User
193+
194+
In the default configuration, this mapping is triggered when Segment sends a Group call to Amplitude (Actions).
195+
196+
Set or update properties of particular groups. These Group updates only affect events that occur after you set up the Amplitude mapping. You cannot use this to group historical data.
197+
198+
> tip ""
199+
> If you are on a Business Tier Segment plan, you can use [Replay](/docs/guides/what-is-replay/) to run historical data through the Amplitude (Actions) destination to apply the grouping.
200+
201+
202+
203+
## Important differences from the classic Amplitude destination
204+
205+
Following user fields are captured by the classic Amplitude destination in device-mode (meaning when it runs on the user’s device), but are not captured by Amplitude (Actions):
206+
207+
- Device Type (for example, Mac, PC, mobile device)
208+
- Platform (for example iOS or Android)
209+
210+
211+
212+
## Replicating classic Amplitude destination settings
213+
214+
Most of the classic Amplitude destination settings were related to device-mode collection (for example, batching or Log Revenue V2), and do not apply to the Amplitude (Actions) destination, which runs in cloud-mode. The following sections discuss how to replicate the old settings where possible.
215+
216+
> info “”
217+
> Contact Segment support if you find features missing from the Amplitude (Actions) destination that were available in the classic Amplitude destination.
218+
219+
### Track Named, Categorized, or All Pages or Screens
220+
221+
The default Amplitude (Actions) subscription sends *all* Page and Screen calls.
222+
To replicate the old behavior, change the trigger to include only events that contain `name` or `category`.
223+
224+
### Prefer Anonymous ID for Device ID
225+
226+
To replicate the old behavior, change the mapping for Device ID field.
227+
Default:
228+
```objc
229+
'@if': {
230+
exists: { '@path': '$.context.device.id' },
231+
then: { '@path': '$.context.device.id' },
232+
else: { '@path': '$.anonymousId' }
233+
}
234+
```
235+
236+
### Use AdvertisingId for DeviceId
237+
238+
To replicate the old behavior, change the mapping for Device ID field.
239+
Default:
240+
```objc
241+
'@if': {
242+
exists: { '@path': '$.context.device.id' },
243+
then: { '@path': '$.context.device.id' },
244+
else: { '@path': '$.anonymousId' }
245+
}
246+
```
247+
248+
249+
### Location Tracking
250+
251+
Location Tracking is a feature of Amplitude’s mobile SDKs and is not supported in Amplitude (Actions) which run in cloud-mode only.
252+
This setting required that the user grant location permission for the mobile app. This is different from the IP-based location lookup that Amplitude can perform.
253+
254+
To work around this limitation, send `context.location.latitude` and `context.location.longitude` from your app, and let Amplitude perform the lookup.

0 commit comments

Comments
 (0)