Common data models for segment data such as
sessions and a user roll up table built from
Add the package to your
package.json file in your Dataform project. You can find the most up to package version on the releases page.
Create a new JS file in your
definitions/ folder and create the segment tables with the following example:
For more advanced uses cases, see the example.js.
This primary outputs of this package are the following data models (configurable as tables or views).
Contains a combined view of tracks, pages and screens from segment. Each session is a period of sustained activity, with a new session starting after a 30min+ period of inactivity. Each session contains a repeated field of records which are either tracks or pages. Common fields are extracted out into the top level and type specific fields are kept within two structs:
includeTracks: true, includePages: true, includeScreens: false
includeTracks: true, includePages: false, includeScreens: true
includeTracks: true, includePages: true, includeScreens: true
At least one of inicludeTracks, includePages, or inclueScreens must be set as true
Aggregates all identifies calls to give a table with one row per user_id. Identify calls with only an anonymous_id are mapped to the matching user_id where possible.