Skip to content

Instantly share code, notes, and snippets.

@kippjb
Last active August 8, 2016 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kippjb/9d968914c68ed6158888 to your computer and use it in GitHub Desktop.
Save kippjb/9d968914c68ed6158888 to your computer and use it in GitHub Desktop.
Instructions for downloading, compiling, and parsing KISSmetrics data exports by event

##Instructions for downloading, compiling, and parsing KISSmetrics data exports by event

####Summary: The KISSmetrics data export feature does not allow users an easy way to analyze data by event. This Gist outlines instructions for downloading and parsing KISSmetrics data for event-level analysis.

#####Step 1: Export data from KISSmetrics

Set up AWS S3 bucket.

Export data from KISSmetrics to your S3 bucket.

  • You will see a bunch of .json files.
  • These .json files will contain all events that occur within a set timeframe (~1 hour).
  • Note: The AWS web interface only allows you to download one file at a time. To download multiple files, you will need the AWS CLI.

#####Step 2: Download data using AWS CLI

Install AWS CLI.

  • Choose your own adventure!

Configure AWS CLI.

  • AWS Access Key ID
  • AWS Secret Access Key
  • Default region name
  • Default output format (optional)

Download files from S3.

$ aws s3 sync s3://mybucket /mylocalpath

#####Step 3: Augment data

Install this handy gem from Clay Whitley.

$ gem install km-export-processor -v 0.3.6

Navigate to location of downloaded KM files.

$ cd Documents/km-export

Compile .json files into single file.

$ km-export-processor json_compiler

Perform any parsing/conversions on the resulting compiled file.

$ km-export-processor json_to_csv <file_name>.json
$ km-export-processor json_to_json <file_name>.json
$ km-export-processor parse_identity <file_name>.json test@test.com

#####Step 4: Analyze data!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment