Giter Site home page Giter Site logo

rsiferd2 / snowplow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dbt-labs/snowplow

0.0 1.0 0.0 966 KB

Data models for snowplow analytics.

Home Page: https://hub.getdbt.com/fishtown-analytics/snowplow/latest/

License: Apache License 2.0

LookML 98.21% Makefile 1.79%

snowplow's Introduction

Snowplow sessionization

This dbt package:

  • Rolls up page_view and page_ping events into page views and sessions
  • Performs "user stitching" to tie all historical events associated with an anonymous cookie (domain_userid) to the same user_id

Adapted from Snowplow's web model.

Models

The primary ouputs of this package are page views and sessions. There are several intermediate models used to create these two models.

model description
snowplow_page_views Contains a list of pageviews with scroll depth, view timing, and optionally useragent and performance data.
snowplow_sessions Contains a rollup of page views indexed by cookie id (domain_sessionid)

snowplow graph

Prerequisites

This package takes the Snowplow JavaScript tracker as its foundation. It assumes that all Snowplow events are sent with a web_page context.

Mobile

It is possible to sessionize mobile (app) events by including two predefined contexts with all events:

As long as all events are associated with an anonymous user, a session, and a screen/page view, they can be made to fit the same canonical data model as web events fired from the JavaScript tracker. Whether this is the desired outcome will vary significantly; mobile-first analytics often makes different assumptions about user identity, engagement, referral, and inactivity cutoffs.

For specific implementation details:

Installation Instructions

Check dbt Hub for the latest installation instructions, or read the docs for more information on installing packages.

Configuration

The variables needed to configure this package are as follows:

variable information required
snowplow:timezone Timezone in which analysis takes place. Used to calculate local times. No
snowplow:page_ping_frequency Configured timeout for page pings in tracker (seconds). Default=30 No
snowplow:events Schema and table containing all snowplow events Yes
snowplow:context:web_page Schema and table for web page context Yes
snowplow:context:performance_timing Schema and table for perf timing context, or false if none is present Yes
snowplow:context:useragent Schema and table for useragent context, or false if none is available Yes
snowplow:pass_through_columns Additional columns for inclusion in final models No
snowplow:page_view_lookback_days Amount of days to rescan to merge page_views in the same session Yes

An example dbt_project.yml configuration:

# dbt_project.yml

...

vars:
  'snowplow:timezone': 'America/New_York'
  'snowplow:page_ping_frequency': 10
  'snowplow:events': "{{ ref('sp_base_events') }}"
  'snowplow:context:web_page': "{{ ref('sp_base_web_page_context') }}"
  'snowplow:context:performance_timing': false
  'snowplow:context:useragent': false
  'snowplow:pass_through_columns': []
  'snowplow:page_view_lookback_days': 1

Database support

Core:

  • Redshift
  • Snowflake
  • BigQuery
  • Postgres

Plugins:

Contributions

Additional contributions to this package are very welcome! Please create issues or open PRs against master. Check out this post on the best workflow for contributing to a package..

Much of tracking can be the Wild West. Snowplow's canonical event model is a major asset in our ability to perform consistent analysis atop predictably structured data, but any detailed implementation is bound to diverge.

To that end, we aim to keep this package rooted in a garden-variety Snowplow web deployment. All PRs should seek to add or improve functionality that is contained within a plurality of Snowplow deployments.

If you need to change implementation-specific details, you have two avenues:

  • Override models from this package with versions that feature your custom logic. Create a model with the same name locally (e.g. snowplow_id_map) and disable the snowplow package's version in dbt_project.yml:
snowplow:
    ...
    identification:
      default:
        snowplow_id_map:
          +enabled: false
  • Fork this repository :)

snowplow's People

Contributors

drewbanin avatar jthandy avatar jtcohen6 avatar axelazaid avatar jwerderits avatar sphinks avatar ericalouie avatar clrcrl avatar tayloramurphy avatar sanjanasen96 avatar emilieschario avatar elyse-weiss avatar selvaticus avatar fred-shaykis avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.