Skip to content

Commit f0c2cbe

Browse files
committed
DOC-240 reorg amp actions
1 parent 9602750 commit f0c2cbe

File tree

2 files changed

+219
-38
lines changed

2 files changed

+219
-38
lines changed
Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
{% assign configMap = site.data.actions.amplitude.config %}
2+
3+
<style>
4+
tr.no-map td {
5+
opacity: 0.5;
6+
}
7+
8+
tr.show {
9+
display: table-row;
10+
}
11+
12+
.settingRow {
13+
display: none;
14+
}
15+
16+
.table-search {
17+
width: 100%;
18+
border: 0px;
19+
border-bottom: 1px solid rgb(128, 128, 128);
20+
font-family: "SF Pro Text", BlinkMacSystemFont, -apple-system, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
21+
color: #474d66;
22+
font-size: 12px;
23+
height: 30px;
24+
margin-bottom: 15px;
25+
}
26+
27+
.table-search:focus-visible {
28+
outline: none
29+
}
30+
31+
.button-container {
32+
display: flex;
33+
justify-content: space-around;
34+
}
35+
36+
.button-link {
37+
padding: 4px 10px;
38+
}
39+
40+
.active {
41+
background-color: #eee;
42+
}
43+
44+
.cmode {
45+
background-color: #edeff5;
46+
font-size: 11px;
47+
padding: 0px 6px;
48+
border-radius: 4px;
49+
height: 16px;
50+
font-weight: 600;
51+
text-transform: uppercase;
52+
color: rgb(71, 77, 102);
53+
opacity: 0.65;
54+
white-space: nowrap;
55+
}
56+
57+
.device-web-mode, .device-mobile-mode {
58+
background-color: #e6f5ef;
59+
color: #317159
60+
}
61+
62+
</style>
63+
64+
### Amplitude settings mapping
65+
66+
<input class="table-search" type="text" id="filterInput" onkeyup="searchFilter()" placeholder="Search for setting..">
67+
<div class="button-container" id="btnContainer">
68+
<a href="#" id="all" class="button button-link active">All</a>
69+
<a href="#" id="true" class="button button-link" >Configurable</a>
70+
<a href="#" id="false" class="button button-link" >Not Configurable</a>
71+
<a href="#" id="cloud" class="button button-link">Cloud</a>
72+
<a href="#" id="device-web" class="button button-link" >Device-web</a>
73+
<a href="#" id="device-mobile" class="button button-link" >Device-mobile</a>
74+
</div>
75+
76+
<table id="settingsTable">
77+
<thead>
78+
<tr>
79+
<th>Amplitude 1.0 Destination Setting</th>
80+
<!-- <th>Configurable in Amplitude (Actions)?</th> -->
81+
<th>How to enable in Amplitude (Actions)</th>
82+
</tr>
83+
</thead>
84+
<tbody>
85+
{% for category in configMap %}
86+
<tr>
87+
<td colspan="3" style="font-weight: bold; background-color:fafbff;font-size: 10px; text-transform: uppercase;">
88+
{{category.category}}</td>
89+
</tr>
90+
{% for setting in category.settings%}
91+
<tr
92+
class="settingRow {%unless setting.configurable%}no-map{%endunless%} {{setting.configurable}} {% for mode in setting.connection_mode %}{{mode}} {%endfor%}"
93+
id="settingRow">
94+
<td>{{setting.name}} <br /> {% for mode in setting.connection_mode %}<span
95+
class="cmode {{mode}}-mode">{{mode | capitalize}}</span> {% endfor %}</td>
96+
<!-- <td>{{setting.configurable}}</td> -->
97+
<td>{% if setting.location %}{{setting.location | markdownify}} <br /> <br /> {% endif %}{{setting.notes | markdownify}}</td>
98+
</tr>
99+
{% endfor %}
100+
{% endfor %}
101+
</tbody>
102+
</table>
103+
104+
<script>
105+
function searchFilter() {
106+
var input, filter, table, tr, td, i, txtValue;
107+
108+
input = document.getElementById("filterInput");
109+
filter = input.value.toUpperCase();
110+
table = document.getElementById("settingsTable");
111+
tr = document.getElementsByClassName("settingRow");
112+
for (i = 0; i < tr.length; i++) {
113+
td = tr[i].getElementsByTagName("td")[0];
114+
if (td) {
115+
txtValue = td.textContent || td.innerText;
116+
if (txtValue.toUpperCase().indexOf(filter) > -1) {
117+
tr[i].style.display = "";
118+
} else {
119+
tr[i].style.display = "none"
120+
}
121+
}
122+
}
123+
}
124+
clickFilter("all")
125+
126+
var links = document.getElementsByClassName("button-link");
127+
128+
129+
document.querySelectorAll('.button-link').forEach(item => {
130+
let v = item.getAttribute('id');
131+
item.addEventListener('click', (event => {
132+
event.preventDefault();
133+
clickFilter(v);
134+
}))
135+
})
136+
137+
138+
function clickFilter(c) {
139+
var x, i;
140+
x = document.getElementsByClassName("settingRow");
141+
if (c == "all") c = "";
142+
for (i = 0; i < x.length; i++) {
143+
w3RemoveClass(x[i], "show");
144+
if (x[i].className.indexOf(c) > -1) w3AddClass(x[i], "show");
145+
}
146+
}
147+
148+
// Show filtered elements
149+
function w3AddClass(element, name) {
150+
var i, arr1, arr2;
151+
arr1 = element.className.split(" ");
152+
arr2 = name.split(" ");
153+
for (i = 0; i < arr2.length; i++) {
154+
if (arr1.indexOf(arr2[i]) == -1) {
155+
element.className += " " + arr2[i];
156+
}
157+
}
158+
}
159+
160+
// Hide elements that are not selected
161+
function w3RemoveClass(element, name) {
162+
var i, arr1, arr2;
163+
arr1 = element.className.split(" ");
164+
arr2 = name.split(" ");
165+
for (i = 0; i < arr2.length; i++) {
166+
while (arr1.indexOf(arr2[i]) > -1) {
167+
arr1.splice(arr1.indexOf(arr2[i]), 1);
168+
}
169+
}
170+
element.className = arr1.join(" ");
171+
}
172+
173+
var btnContainer = document.getElementById("btnContainer");
174+
var btns = document.getElementsByClassName("button-link");
175+
for (var i = 0; i < btns.length; i++) {
176+
btns[i].addEventListener("click", function () {
177+
var current = document.getElementsByClassName("active");
178+
current[0].className = current[0].className.replace(" active", "");
179+
this.className += " active";
180+
});
181+
}
182+
183+
</script>

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

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,16 @@ and conversion.
1616
> info ""
1717
> This document is about a feature which is in beta. This means that the Destination Actions are in active development, and some functionality may change before it becomes generally available
1818
19-
![](images/amplitude-actions-tab.png)
2019

2120
> success ""
2221
> **Good to know**: This page is about the [Actions-framework](/docs/connections/destinations/actions/) Amplitude Segment destination. There's also a page about the [non-Actions Amplitude destination](/docs/connections/destinations/catalog/amplitude/). Both of these destinations receives data _from_ Segment. There's also the [Amplitude Engage Segment source](/docs/connections/sources/catalog/cloud-apps/amplitude-cohorts/), which sends data _to_ Segment!
2322
2423

25-
## Connection Modes for Amplitude (Actions) destination
2624

27-
The Amplitude (actions) destination does not offer a device-mode connection mode. If you're using one of Segment's new libraries ([Analytics.js 2.0](/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.
28-
29-
Most previous deployments of the Amplitude Segment destination used the device-mode connection to use the `session_id` tracking feature. The new Actions-framework Amplitude destination, includes session ID tracking by default. This means you don’t need to bundle any software to run on the user’s device, or write any code. It also means that you can use more of the Segment platform features on data going to Amplitude, such as Protocols filtering and transformations, and Personas identity resolution.
30-
31-
32-
Session tracking is available with Segment's new libraries: [Analytics.js 2.0](/docs/connections/sources/catalog/libraries/website/javascript/), [Swift](https://github.com/segmentio/analytics-swift) or [Kotlin](https://github.com/segmentio/analytics-kotlin)
3325

3426

3527

36-
## Getting Started
28+
## Getting started
3729

3830
1. Before you start, go to your [Amplitude workspace](https://analytics.amplitude.com){:target="_blank"}. Click **Settings** in the bottom left, then click **Projects** in the left menu. Select your **Project**. Copy the Amplitude API Key and Secret Key for the project.
3931
2. From the Segment web app, click **Catalog**, then click **Destinations**.
@@ -45,9 +37,19 @@ Session tracking is available with Segment's new libraries: [Analytics.js 2.0](/
4537

4638
Once you have a mapping, you can follow the steps in the Destinations Actions documentation on [Customizing mappings](/docs/connections/destinations/actions/#customizing-mappings).
4739

40+
### Connection Modes for Amplitude (Actions) destination
41+
42+
The Amplitude (actions) destination does not offer a device-mode connection mode. If you're using one of Segment's new libraries ([Analytics.js 2.0](/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.
43+
44+
Most previous deployments of the Amplitude Segment destination used the device-mode connection to use the `session_id` tracking feature. The new Actions-framework Amplitude destination, includes session ID tracking by default. This means you don’t need to bundle any software to run on the user’s device, or write any code. It also means that you can use more of the Segment platform features on data going to Amplitude, such as Protocols filtering and transformations, and Personas identity resolution.
45+
46+
Session tracking is available with Segment's new libraries: [Analytics.js 2.0](/docs/connections/sources/catalog/libraries/website/javascript/), [Swift](https://github.com/segmentio/analytics-swift) or [Kotlin](https://github.com/segmentio/analytics-kotlin)
47+
4848

4949
### Device ID Mappings
50-
The Amplitude destination requires that each event include either a Device ID or a User ID. If a User ID isn't present, Amplitude uses the a Device ID, and vice versa, if a Device ID isn't present, Amplitude uses the User ID. By default, Segment maps the Segment property `context.device.id` to the Amplitude property `Device ID`. If `context.device.id` isn't available, Segment maps the property `anonymousId` to the Amplitude `Device ID`. This is indicated by the following text in the Device ID field: `coalesce(` `context.device.id` `anonymousId` `)`.
50+
The Amplitude destination requires that each event include either a Device ID or a User ID. If a User ID isn't present, Amplitude uses the a Device ID, and vice versa, if a Device ID isn't present, Amplitude uses the User ID.
51+
52+
By default, Segment maps the Segment property `context.device.id` to the Amplitude property `Device ID`. If `context.device.id` isn't available, Segment maps the property `anonymousId` to the Amplitude `Device ID`. This is indicated by the following text in the Device ID field: `coalesce(` `context.device.id` `anonymousId` `)`.
5153

5254
### Enable session tracking for Analytics.js 2.0
5355

@@ -76,19 +78,15 @@ To enable session tracking in Amplitude when using the [Segment Kotlin library](
7678
```
7779

7880

79-
## Available Amplitude Actions
80-
81-
Amplitude supports the following Actions:
81+
## Important differences from the classic Amplitude destination
8282

83-
- Log Event
84-
- Identify User
85-
- Map User
86-
- Group Identify User
83+
The following user fields are captured by the classic Amplitude destination in device-mode (when it runs on the user’s device), but are not captured by Amplitude (Actions):
8784

88-
You can see the Segment event fields Amplitude accepts for each action in the Actions subscription set up page.
85+
- Device Type (for example, Mac, PC, mobile device)
86+
- Platform (for example iOS or Android)
8987

9088

91-
## Quick set-up actions
89+
## Pre-built subscriptions
9290

9391
By default a new Amplitude (Actions) destination comes with the following subscriptions.
9492

@@ -101,11 +99,20 @@ You can select these subscriptions by choosing "Quick Setup" when you first conf
10199
| Screen Calls | All **screen** calls from the connected source | Log Event | Event Type = Viewed `name`<br>for example, `Viewed Homescreen` |
102100
| Identify Calls | All **identify** calls from the connected source | Identify User | |
103101

104-
![](images/actions-amplitude-defaults.png)
105102

103+
## Available Amplitude Actions
104+
105+
Build your own subscriptions with the following Amplitude-supported actions:
106+
107+
- [Log Event](#log-event)
108+
- [Identify User](#identify-user)
109+
- [Map User](#map-user)
110+
- [Group Identify User](#group-identify-user)
111+
112+
You can see the Segment event fields Amplitude accepts for each action in the Actions subscription set up page.
106113

107114

108-
## Amplitude’s Log Event Action
115+
### Log Event
109116

110117
In the default configuration, the Log Event mapping is triggered when Segment sends a Track call to Amplitude (Actions).
111118

@@ -159,7 +166,7 @@ analytics.track({
159166
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.
160167
{% endcomment %}
161168

162-
### Track Revenue Per Product
169+
#### Track Revenue Per Product
163170

164171
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.
165172

@@ -169,7 +176,7 @@ If you enable the setting ("on"), Segment sends a single revenue event for each
169176

170177
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.
171178

172-
### Send To Batch Endpoint
179+
#### Send To Batch Endpoint
173180

174181

175182
> info ""
@@ -180,21 +187,21 @@ If `true`, events are sent to Amplitude’s `batch` endpoint rather than to thei
180187

181188
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).
182189

183-
## Identify User
190+
### Identify User
184191

185192
In the default configuration, this mapping is triggered when Segment sends an Identify call to Amplitude (Actions).
186193

187194
This Action sets the user ID for a specific device ID, or updates the user properties. You can use this when you want to update user information without sending an Event to Amplitude.
188195

189196

190-
## Map User
197+
### Map User
191198

192199
In the default configuration, this mapping is triggered when Segment sends an Alias call to Amplitude (Actions).
193200

194201
This Action merges two users together that would otherwise have different User IDs tracked in Amplitude. You can use this when you want to merge the users without sending an Event to Amplitude.
195202

196203

197-
## Group Identify User
204+
### Group Identify User
198205

199206
In the default configuration, this mapping is triggered when Segment sends a Group call to Amplitude (Actions).
200207

@@ -205,18 +212,7 @@ These Group updates only affect events that occur after you set up the Amplitude
205212
> success ""
206213
> 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.
207214
208-
209-
210-
## Important differences from the classic Amplitude destination
211-
212-
The following user fields are captured by the classic Amplitude destination in device-mode (when it runs on the user’s device), but are not captured by Amplitude (Actions):
213-
214-
- Device Type (for example, Mac, PC, mobile device)
215-
- Platform (for example iOS or Android)
216-
217-
218-
219-
## Replicating classic Amplitude destination settings
215+
## Migration from Amplitude Classic
220216

221217
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.
222218

@@ -259,3 +255,5 @@ Location Tracking is a feature of Amplitude’s mobile SDKs and is not supported
259255
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.
260256

261257
To work around this limitation, send `context.location.latitude` and `context.location.longitude` from your app, and let Amplitude perform the lookup.
258+
259+
{% include components/actions-map-table.html %}

0 commit comments

Comments
 (0)