Skip to content

Commit d5cd5da

Browse files
author
markzegarelli
authored
Common Spec cleanup (#2610)
1 parent d11704c commit d5cd5da

File tree

3 files changed

+62
-58
lines changed

3 files changed

+62
-58
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
<thead>
12
<tr>
23
<th>Field</th>
34
<th></th>
45
<th>Type</th>
56
<th>Description</th>
67
</tr>
8+
</thead>

src/connections/spec/common.md

Lines changed: 54 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,13 @@ Beyond this common structure, each API call adds a few specialized top-level fie
122122
Context is a dictionary of extra information that provides useful context about a datapoint, for example the user's `ip` address or `locale`. You should **only use** Context fields for their intended meaning.
123123

124124
<table>
125+
<thead>
125126
<tr>
126-
<td>**Field**</td>
127-
<td>**Type**</td>
128-
<td>**Description**</td>
127+
<th>Field</th>
128+
<th>Type</th>
129+
<th>Description</th>
129130
</tr>
131+
</thead>
130132
<tr>
131133
<td>`active`</td>
132134
<td>Boolean</td>
@@ -140,7 +142,7 @@ Context is a dictionary of extra information that provides useful context about
140142
<td>Object</td>
141143
<td>dictionary of information about the current application, containing `name`, `version` and `build`.
142144
<br><br>
143-
This is collected automatically from our mobile libraries when possible.
145+
This is collected automatically from the mobile libraries when possible.
144146
</td>
145147
</tr>
146148
<tr>
@@ -189,7 +191,7 @@ Context is a dictionary of extra information that provides useful context about
189191
<tr>
190192
<td>`page`</td>
191193
<td>Object</td>
192-
<td>Dictionary of information about the current page in the browser, containing `path`, `referrer`, `search`, `title` and `url`. This is automatically collected by [Analytics.js](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#context--traits).
194+
<td>Dictionary of information about the current page in the browser, containing `path`, `referrer`, `search`, `title` and `url`. This is automatically collected by [Analytics.js](/docs/connections/sources/catalog/libraries/website/javascript/#context--traits).
193195
</td>
194196
</tr>
195197
<tr>
@@ -231,58 +233,58 @@ Context is a dictionary of extra information that provides useful context about
231233

232234
## Context Fields Automatically Collected
233235

234-
Below is a chart that shows you which context variables are populated automatically by our iOS, Android and analytics.js libraries.
236+
Below is a chart that shows you which context variables are populated automatically by the iOS, Android and analytics.js libraries.
235237

236238
Other libraries only collect `context.library`, any other context variables must be sent manually.
237239

238240
| Context Field | Analytics.js | Analytics-ios | Analytics-android |
239-
|--------------------------|--------------|---------------|-------------------|
240-
| app.name | | | |
241-
| app.version | | | |
242-
| app.build | | | |
243-
| campaign.name | | | |
244-
| campaign.source | | | |
245-
| campaign.medium | | | |
246-
| campaign.term | | | |
247-
| campaign.content | | | |
248-
| device.type | | | |
249-
| device.id | | | |
250-
| device.advertisingId | | | |
251-
| device.adTrackingEnabled | | | |
252-
| device.manufacturer | | | |
253-
| device.model | | | |
254-
| device.name | | | |
255-
| library.name | | | |
256-
| library.version | | | |
257-
| ip* | | | |
258-
| locale | | | |
241+
| ------------------------ | ------------ | ------------- | ----------------- |
242+
| app.name | | | |
243+
| app.version | | | |
244+
| app.build | | | |
245+
| campaign.name | | | |
246+
| campaign.source | | | |
247+
| campaign.medium | | | |
248+
| campaign.term | | | |
249+
| campaign.content | | | |
250+
| device.type | | | |
251+
| device.id | | | |
252+
| device.advertisingId | | | |
253+
| device.adTrackingEnabled | | | |
254+
| device.manufacturer | | | |
255+
| device.model | | | |
256+
| device.name | | | |
257+
| library.name | | | |
258+
| library.version | | | |
259+
| ip* | | | |
260+
| locale | | | |
259261
| location.latitude | | | |
260262
| location.longitude | | | |
261263
| location.speed | | | |
262-
| network.bluetooth | | | |
263-
| network.carrier | | | |
264-
| network.cellular | | | |
265-
| network.wifi | | | |
266-
| os.name | | | |
267-
| os.version | | | |
268-
| page.path | | | |
269-
| page.referrer | | | |
270-
| page.search | | | |
271-
| page.title | | | |
272-
| page.url | | | |
273-
| screen.density | | | |
274-
| screen.height | | | |
275-
| screen.width | | | |
276-
| traits | | | |
277-
| userAgent | | | |
278-
| timezone | | | |
279-
280-
- IP Address is not collected by our libraries, but instead filled in by our servers when it receives a message for **client side events only**.
281-
- Our Android library collects `screen.density` with [this method](/docs/connections/spec/common/#context-fields-automatically-collected).
264+
| network.bluetooth | | | |
265+
| network.carrier | | | |
266+
| network.cellular | | | |
267+
| network.wifi | | | |
268+
| os.name | | | |
269+
| os.version | | | |
270+
| page.path | | | |
271+
| page.referrer | | | |
272+
| page.search | | | |
273+
| page.title | | | |
274+
| page.url | | | |
275+
| screen.density | | | |
276+
| screen.height | | | |
277+
| screen.width | | | |
278+
| traits | | | |
279+
| userAgent | | | |
280+
| timezone | | | |
281+
282+
- IP Address is not collected by Segment's libraries, but instead filled in by Segmen'ts servers when it receives a message for **client side events only**.
283+
- The Android library collects `screen.density` with [this method](/docs/connections/spec/common/#context-fields-automatically-collected).
282284

283285
## Integrations
284286

285-
A dictionary of destination names that the message should be sent to. `'All'` is a special key that applies when no key for a specific destinatio n is found.
287+
A dictionary of destination names that the message should be sent to. `'All'` is a special key that applies when no key for a specific destination n is found.
286288

287289
Integrations defaults to the following:
288290

@@ -293,9 +295,9 @@ Integrations defaults to the following:
293295
}
294296
```
295297

296-
This is because [Salesforce](/docs/connections/destinations/catalog/salesforce/) has strict limits on API calls, and we don't want to run over your limits by accident.
298+
This is because [Salesforce](/docs/connections/destinations/catalog/salesforce/) has strict limits on API calls.
297299

298-
Sending data to the rest of our destinations is opt-out so if you don't specify the destination as false in this object, it will be sent to rest of the destinations that can accept it.
300+
Sending data to the rest of Segment's destinations is opt-out so if you don't specify the destination as false in this object, it will be sent to rest of the destinations that can accept it.
299301

300302

301303
## Timestamps
@@ -378,16 +380,16 @@ The `originalTimestamp` tells you when call was invoked on the client device or
378380

379381
### sentAt
380382

381-
The `sentAt` timestamp specifies the clock time for the client's device when the network request was made to the Segment API. For libraries and systems that send batched requests, there can be a long gap between a datapoint's `timestamp` and `sentAt`. Combined with `receivedAt`, we can use `sentAt` to correct the original `timestamp` in situations where a user's device clock cannot be trusted (mobile phones and browsers). The `sentAt` and `receivedAt` timestamps are assumed to occur at the same time (maximum a few hundred milliseconds), and therefore the difference is the user's device clock skew, which can be applied back to correct the `timestamp`.
383+
The `sentAt` timestamp specifies the clock time for the client's device when the network request was made to the Segment API. For libraries and systems that send batched requests, there can be a long gap between a datapoint's `timestamp` and `sentAt`. Combined with `receivedAt`, Segment uses `sentAt` to correct the original `timestamp` in situations where a user's device clock cannot be trusted (mobile phones and browsers). The `sentAt` and `receivedAt` timestamps are assumed to occur at the same time (maximum a few hundred milliseconds), and therefore the difference is the user's device clock skew, which can be applied back to correct the `timestamp`.
382384

383385
**Note:** The `sentAt` timestamp is not useful for any analysis since it's tainted by user's clock skew.
384386

385387

386388
### receivedAt
387389

388-
The `receivedAt` timestamp is added to incoming messages as soon as they hit our API. It's used in combination with `sentAt` to correct clock skew, and also to aid with debugging libraries and systems that deliver events in batches.
390+
The `receivedAt` timestamp is added to incoming messages as soon as they hit the API. It's used in combination with `sentAt` to correct clock skew, and also to aid with debugging libraries and systems that deliver events in batches.
389391

390-
The `receivedAt` timestamp is most important as the sort key in our Warehouses product. Use this for max query speed when retrieving data from your Warehouse!
392+
The `receivedAt` timestamp is most important as the sort key in Segment's Warehouses product. Use this for max query speed when retrieving data from your Warehouse!
391393

392394
**Note:** Chronological order of events is not ensured with `receivedAt`.
393395

src/protocols/tracking-plan/create.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ To create a new Tracking Plan:
3232
### Tracking Plan Columns
3333
The Tracking Plan editor is organized as a spreadsheet to help you add new events and properties, and edit the relevant fields for each. Like a spreadsheet, you can navigate across cells in a single event with your arrow keys and press enter to edit a cell.
3434

35-
| Column Name | Details |
36-
| ------------ | --------- |
37-
| Name | Specify the name of your event or property. |
38-
| Description | Enter a description for your event or property. These descriptions are helpful for both engineers instrumenting Segment and consumers of the data. |
39-
| Status | Specify whether a property is required or optional. You can't require a `.track()` call because Segment is unable to verify when a `.track()` call should be fired. |
40-
| Data Type | Specify the data type of the property. Data type options include `any, array, object, boolean, integer, number, string, Date time`. Note: Date time is required to be in ISO-8601 format |
35+
| Column Name | Details |
36+
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
37+
| Name | Specify the name of your event or property. |
38+
| Description | Enter a description for your event or property. These descriptions are helpful for both engineers instrumenting Segment and consumers of the data. |
39+
| Status | Specify whether a property is required or optional. You can't require a `.track()` call because Segment is unable to verify when a `.track()` call should be fired. |
40+
| Data Type | Specify the data type of the property. Data type options include `any, array, object, boolean, integer, number, string, Date time`. Note: Date time is required to be in ISO-8601 format |
4141
| Permitted Values | Enter simple regular expressions to validate property values. This works when a property data type is set to `string`. For example, you can add pipe delimited strings to the regex column to generate violations when a property value does not match fall, winter or spring. |
4242

4343
> info ""

0 commit comments

Comments
 (0)