Skip to content

Commit a31b710

Browse files
author
markzegarelli
authored
Merge pull request #1772 from segmentio/DOC-240_actions-migration-proto
DOC-240 Amplitude Actions Update and Migration Template
2 parents a8aca37 + 2beb918 commit a31b710

File tree

16 files changed

+776
-101
lines changed

16 files changed

+776
-101
lines changed

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ description: ""
33
baseurl: "/docs" # the subpath of your site, e.g. /blog
44
url: "https://segment.com" # the base hostname & protocol for your site, e.g. http://example.com
55
source: ./src
6+
incremental: true
67

78

89
permalink: /:categories/:title/

js/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import tracking from './tracking'
2020
import searchBar from './search-bar'
2121
import glightbox from './glightbox'
2222
import autocomplete from './algolia'
23+
import mapTable from './map-table'
2324
feedback()
2425
accordion()
2526
accordionGroup()
@@ -40,4 +41,5 @@ relativeLinks()
4041
sideMenu()
4142
tracking()
4243
searchBar()
43-
glightbox()
44+
glightbox()
45+
mapTable()

js/littlefoot/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { littlefoot } from 'littlefoot'
2+
3+
export default function () {
4+
littlefoot({
5+
}
6+
)
7+
8+
}

js/map-table/index.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
export default function () {
2+
3+
clickFilter("all")
4+
5+
var links = document.getElementsByClassName("button-link");
6+
7+
8+
document.querySelectorAll('.button-link').forEach(item => {
9+
let v = item.getAttribute('id');
10+
item.addEventListener('click', (event => {
11+
event.preventDefault();
12+
clickFilter(v);
13+
}))
14+
})
15+
16+
17+
function clickFilter(c) {
18+
var x, i;
19+
x = document.getElementsByClassName("settingRow");
20+
if (c == "all") c = "";
21+
for (i = 0; i < x.length; i++) {
22+
w3RemoveClass(x[i], "show");
23+
if (x[i].className.indexOf(c) > -1) w3AddClass(x[i], "show");
24+
}
25+
}
26+
27+
// Show filtered elements
28+
function w3AddClass(element, name) {
29+
var i, arr1, arr2;
30+
arr1 = element.className.split(" ");
31+
arr2 = name.split(" ");
32+
for (i = 0; i < arr2.length; i++) {
33+
if (arr1.indexOf(arr2[i]) == -1) {
34+
element.className += " " + arr2[i];
35+
}
36+
}
37+
}
38+
39+
// Hide elements that are not selected
40+
function w3RemoveClass(element, name) {
41+
var i, arr1, arr2;
42+
arr1 = element.className.split(" ");
43+
arr2 = name.split(" ");
44+
for (i = 0; i < arr2.length; i++) {
45+
while (arr1.indexOf(arr2[i]) > -1) {
46+
arr1.splice(arr1.indexOf(arr2[i]), 1);
47+
}
48+
}
49+
element.className = arr1.join(" ");
50+
}
51+
52+
var btnContainer = document.getElementById("btnContainer");
53+
var btns = document.getElementsByClassName("button-link");
54+
for (var i = 0; i < btns.length; i++) {
55+
btns[i].addEventListener("click", function () {
56+
var current = document.getElementsByClassName("active");
57+
current[0].className = current[0].className.replace(" active", "");
58+
this.className += " active";
59+
});
60+
}
61+
}

netlify.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@
1111
command = "yarn develop"
1212
ignore = "./scripts/ignore.sh"
1313

14+
[context.branch-deploy]
15+
command = "yarn develop-inc"
16+
ignore = "./scripts/ignore.sh"
17+
18+
[[context.branch-deploy.plugins]]
19+
package = "netlify-plugin-jekyll-cache"
20+
21+
[context.branch-deploy.plugins.inputs]
22+
jekyllSource = "/src"
23+
24+
25+
1426
[[redirects]]
1527
from = "/docs/*"
1628
to = "/:splat"

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
]
1212
},
1313
"scripts": {
14-
"develop": "bundle exec jekyll clean && webpack --mode production && JEKYLL_ENV=testing bundle exec jekyll build --trace -V"
15-
},
14+
"develop": "bundle exec jekyll clean && webpack --mode production && JEKYLL_ENV=testing bundle exec jekyll build --trace -V",
15+
"develop-inc": "webpack --mode production && JEKYLL_ENV=testing bundle exec jekyll build --trace -V -I"
16+
17+
},
1618
"devDependencies": {
1719
"@babel/cli": "^7.6.0",
1820
"@babel/core": "^7.6.0",

src/_data/actions/amplitude.yml

Lines changed: 250 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,250 @@
1+
config:
2+
- category: Connection Settings
3+
settings:
4+
- name: API Key
5+
connection_mode:
6+
- cloud
7+
- device-web
8+
- device-mobile
9+
configurable: true
10+
location: Global Setting
11+
notes: ""
12+
- name: Track Products Once
13+
connection_mode:
14+
- device-web
15+
configurable: false
16+
location: null
17+
notes: "Not applicable to Cloud mode"
18+
- name: Version Name
19+
connection_mode:
20+
- device-web
21+
configurable: true
22+
location: "Action field **App Version**."
23+
notes: "Defaults to `context.app.version`."
24+
- name: Connection Mode
25+
connection_mode:
26+
- cloud
27+
- device-web
28+
- device-mobile
29+
configurable: true
30+
location: null
31+
notes: Actions support Cloud mode connections
32+
- category: Page and Screen
33+
settings:
34+
- name: Track all pages to Amplitude
35+
connection_mode:
36+
- cloud
37+
- device-web
38+
- device-mobile
39+
configurable: true
40+
location: "Subscription **Page Calls**"
41+
notes: When enabled, Amplitude (Actions) tracks all Page calls by default
42+
- name: Track all Screens
43+
connection_mode:
44+
- cloud
45+
- device-web
46+
- device-mobile
47+
configurable: true
48+
location: "Subscription **Page Calls**"
49+
notes: When enabled, Amplitude (Actions) tracks all Screen calls by default
50+
- name: Track Categorized Pages to Amplitude
51+
connection_mode:
52+
- cloud
53+
- device-web
54+
- device-mobile
55+
configurable: true
56+
location: "Subscription **Page Calls**"
57+
notes: Add a Trigger filter condition to check that Event Property **category** exists
58+
- name: Track Named Pages to Amplitude
59+
connection_mode:
60+
- cloud
61+
- device-web
62+
- device-mobile
63+
configurable: true
64+
location: "Subscription **Page Calls**"
65+
notes: Add a Trigger filter condition to check that Event Property **name** exists
66+
- category: Traits
67+
settings:
68+
- name: Group Type Trait
69+
connection_mode:
70+
- cloud
71+
- device-web
72+
- device-mobile
73+
configurable: true
74+
location: "Subscription **Group Identify User**."
75+
notes: Select a value in the **Group Type** actions field. This field is mandatory in Amplitude (Actions). In the Amplitude Classic destination, ommiting a value for property field resulted in Amplitude creating a group called `[Segment] Group`.
76+
- name: Group Value Trait
77+
connection_mode:
78+
- cloud
79+
- device-web
80+
- device-mobile
81+
configurable: true
82+
location: "Subscription **Group Identify User**."
83+
notes: Select a value in the **Group Value** actions field. This field is mandatory in Amplitude actions. In the Amplitude Classic destination, ommiting a value for this property resulted in an alpha-numeric value.
84+
- name: Traits to Append
85+
connection_mode:
86+
- cloud
87+
configurable: false
88+
location:
89+
notes: Not supported with Actions
90+
- name: Traits to Increment
91+
connection_mode:
92+
- cloud
93+
- device-web
94+
- device-mobile
95+
configurable: false
96+
location:
97+
notes: Not supported with Actions
98+
- name: Traits to Prepend
99+
connection_mode:
100+
- cloud
101+
configurable: false
102+
location:
103+
notes: Not supported with Actions
104+
- name: Traits to Set Once
105+
connection_mode:
106+
- cloud
107+
- device-web
108+
- device-mobile
109+
configurable: false
110+
location:
111+
notes: Not supported with Actions
112+
- category: Other Settings
113+
settings:
114+
- name: Append Fields to Event Properties
115+
connection_mode:
116+
- device-web
117+
- device-mobile
118+
configurable: false
119+
location:
120+
notes: Not supported with Actions
121+
- name: Batch Events
122+
connection_mode:
123+
- device-web
124+
configurable: true
125+
location: "**Use Batch Endpoint** field on the **Log Event** action"
126+
notes:
127+
- name: Enable Location Listening
128+
connection_mode:
129+
- device-mobile
130+
configurable: false
131+
location:
132+
notes: Use `context.location.latitude` and `context.location.longitude` on the mobile client. Other destinations may also process this data. Amplitude uses IP-based location, if you're unable to send latitude and longitude.
133+
- name: Event Upload period millis
134+
connection_mode:
135+
- device-web
136+
configurable: false
137+
location:
138+
notes: Not configurable for Cloud-mode batching
139+
- name: Event Upload Threshold
140+
connection_mode:
141+
- device-web
142+
configurable: false
143+
location:
144+
notes: Not configurable for Cloud-mode batching
145+
- name: Force HTTPS
146+
connection_mode:
147+
- device-web
148+
configurable: false
149+
location:
150+
notes: Not configurable in Cloud-mode, https is enabled by default.
151+
- name: Map Query Params to Custom Property
152+
connection_mode:
153+
- cloud
154+
- device-web
155+
configurable: false
156+
location:
157+
notes: Not supported with Actions
158+
- name: Prefer Anonymous Device ID
159+
connection_mode:
160+
- cloud
161+
- device-web
162+
- device-mobile
163+
configurable: true
164+
location: Actions field **Device ID**.
165+
notes: Replace the contents of the field with your preferred value.
166+
- name: Save Referrer, URL Params, GCLID Once per Session
167+
connection_mode:
168+
- device-web
169+
configurable: false
170+
location:
171+
notes: This setting supported an edge case that is not applicable to Amplitude (Actions)
172+
- name: Secret Key
173+
connection_mode:
174+
- cloud
175+
- device-web
176+
- device-mobile
177+
configurable: true
178+
location: Global Setting
179+
notes: ""
180+
- name: Enable Alias
181+
connection_mode:
182+
- cloud
183+
configurable: true
184+
location: Use the **Map User** action.
185+
notes: The **Map User** action is not enabled by default. Add a new Subscription to access the **Map User** action.
186+
- name: Send to Batch Endpoint
187+
connection_mode:
188+
- cloud
189+
configurable: true
190+
location: "**Use Batch Endpoint** field on the **Log Event** action"
191+
notes:
192+
- name: Track GCLID
193+
connection_mode:
194+
- device-web
195+
configurable: false
196+
location:
197+
notes: Not supported with Actions
198+
- name: Track Referrer to Amplitude
199+
connection_mode:
200+
- device-web
201+
configurable: false
202+
location:
203+
notes: Not supported with Actions
204+
- name: Track Revenue per Product
205+
connection_mode:
206+
- cloud
207+
- device-web
208+
- device-mobile
209+
configurable: true
210+
location: Actions field **Track Revenue Per Product**.
211+
notes: Available in any subscription that uses the **Log Event** action. <br /> In Amplitude (Actions), this setting elevates `revenue` to a top-level property. This allows revenue data to pass through to Amplitude's LTV reports.
212+
- name: Track Session Events to Amplitude
213+
connection_mode:
214+
- device-web
215+
configurable: false
216+
location:
217+
notes: This setting sends `[Session Started]` and `[Session Ended]` events. However, Session ID is used most often in session-based reporting. Analytics.js sources track Session ID by default. Mobile sources require a plugin to enable Session ID tracking. For more information, see [Enable Session Tracking for Analytics.js 2.0](/docs/connections/destinations/catalog/actions-amplitude/#enable-session-tracking-for-analyticsjs-20)
218+
- name: Track UTM Properties to Amplitude
219+
connection_mode:
220+
- cloud
221+
- device-web
222+
configurable: false
223+
location:
224+
notes: Not supported with Actions
225+
- name: Unset Params Referrer on New Session
226+
connection_mode:
227+
- device-web
228+
configurable: false
229+
location:
230+
notes: Not supported with Actions
231+
- name: Use Advertising ID for Device ID
232+
connection_mode:
233+
- cloud
234+
- device-web
235+
- device-mobile
236+
configurable: true
237+
location: Actions field **Device ID**.
238+
notes: Update the value so your preferred field appears first in the `coalesce()` function.
239+
- name: Send Custom Language and Country Properties
240+
connection_mode: null
241+
configurable: true
242+
location: Actions fields **Language** and **Country**
243+
notes: These fields are set by default with values from the context object.
244+
- name: Use Log Revenue v2 API
245+
connection_mode:
246+
- device-web
247+
- device-mobile
248+
configurable: false
249+
location:
250+
notes: Actions supports Revenue v2. Confirm revenue reporting is working as expected if you migrate from the Classic Amplitude destination where this setting was **disabled**

0 commit comments

Comments
 (0)