Skip to content

patrick-fs/segment-export-cli

Repository files navigation

segex

segex is a command line interface that lets you download FullStory "event" and "individual" data for specific segments via FullStory's Segment Export API. Use it to explore your FullStory Segment Export data locally.

segex is not currently distributed on NPM, so you'll have to pull down this code and execute it locally with ./bin/run. You'll need to have node JS installed on your machine to run segex.

Install

  • Clone this repo and npm install in the root directory (the same directory that contains package.json)
  • Copy and paste .config/fullstory-example.json, rename it .config/fullstory.json, and add your FullStory API key.
{
  "API_KEY": "your key here",
  "API_DOMAIN" : "https://api.fullstory.com"
}

Finding a Segment Id in FullStory

Segments are created by saving FullStory searches. More information can be found on FullStory's help site.

Once you've created a segment in FullStory, you can find the segment ID in the URL when you're viewing the segment.

Example segment IDs

Custom segment

The ID in this example is "patrick@fullstory.com:4241245858598272"

https://app.staging.fullstory.com/ui/thefullstory.com/segments/patrick@fullstory.com:4241245858598272/people/0

Standard segment

The ID in this example is "rageClicks"

https://app.staging.fullstory.com/ui/thefullstory.com/segments/rageClicks/people/0

Usage

$ ./bin/run export

Command arguments and flags

$ ./bin/run --help export
USAGE
  $ segex export [ID]

ARGUMENTS
  ID  [default: everyone] segment id of the segment to be downloaded from FullStory

OPTIONS
  -d, --directory=directory                      [default: ./data] location of the output directory
  -e, --end=end                                  end of query: mm/dd/yyyy, defaults to yesterday (the most recent day that data is available)
  -f, --format=JSON|CSV                          [default: FORMAT_CSV]
  -h, --help                                     show CLI help
  -i, --interval=5m|10m|15m|30m|1h|2h|3h|4h|24h  [default: 15m] time increments for each downloaded file

  -l, --fields=fields                            a comma-delimited list of fields to select - for example: EventStart,EventType. Find the Data Export data 
                                                 dictionary of all fields here: https://developer.fullstory.com/get-data-export

  -s, --start=start                              start of query: mm/dd/yyyy, defaults to 30 days in the past

  -t, --type=event|individual                    [default: TYPE_EVENT]
  • --type event returns event records: each row is an individual event recorded by FullStory. You can find the data dictionary for event records at https://developer.fullstory.com/get-data-export.
  • --type individual returns individual records: each row represents an identified user with some aggregate metrics about their behavior on your site.
  • --interval controls how large your file sizes are: the smaller the interval the smaller the file size, and the greater the number of files.

Data directory structure

The CLI creates files in the data directory at the root of this project by default. The directory structure is:

data
├── {segment id}
│   └── {segment type event|individual}
│       └── {date}
│           ├── {segment export file csv|json}

Output examples

./bin/run export [email protected]:4721245852598272 -s 4/6/2020 -e 4/8/2020 -t event

outputs to

data/[email protected]:4721245852598272/event


./bin/run export [email protected]:4721245852598272 -s 4/6/2020 -e 4/8/2020 -t individual

outputs to

data/[email protected]:4721245852598272/individual


./bin/run export outputs to data/everyone/event

About

CLI for FullStory segment export

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published