/looker-snowplow-mobile

A LookML block, that uses data from the Snowplow JavaScript tracker and Mobile Data Model derived tables and makes it available for exploration in Looker.

Primary LanguageLookMLApache License 2.0Apache-2.0

looker-snowplow-mobile

maintained Release License Discourse posts

This LookML block makes the derived tables produced by the Snowplow Mobile V1 model available for exploration in Looker.

The derived tables are:

  • Mobile Screen Views: Aggregates event level data to a page view level, screen_view_id.
  • Mobile Sessions: Aggregates page view level data to a session level, session_id.
  • Mobile Users: Aggregates session level data to a users level, device_user_id.

A series of dashboards have also been included to help visualize the data.

Set Up

There are two ways to use this block. Either as a fork of this repository and as a local_dependency, or by including it as a remote_dependency.

Forking this repository will allow you to customize this block beyond the available configurable properties in the manifest.lkml. Including this as a remote_dependency means you can use the block as-is and benefit from any future updates we publish directly in Looker without having to update your fork.

Using a fork

  • Fork this repository.
  • Create a new project within your Looker instance, snowplow_mobile_looker_block for example. Select Clone Public Git Repository as your starting point and enter the URL of your forked repository.
  • Within your main Looker project's manifest file, you can add the looker project containing the Snowplow Looker Block as local dependency.
  • Overwrite the connection constant in the manifest file to the database connection where your Snowplow data lives.
project_name: "<your_project_name>"

local_dependency: {
  project: "<project_name_containing_snowplow_block>" 
  override_constant: connection {
    value: "<your_connection_name>"
  }
}
  • Verify that the table and schema names, defined in the manifest file, aligns with the table names in your database. If you are using the snowplow-mobile dbt package you will most likely need to update these. Overwrite these if that is not the case.
project_name: "<your_project_name>"

local_dependency: {
  project: "<project_name_containing_snowplow_block>" 
  override_constant: connection {
    value: "<your_connection_name>"
  }
  override_constant: schema {
    value: "derived"
  }
  override_constant: screen_views_table {
    value: "mobile_screen_views"
  }
  override_constant: sessions_table {
    value: "mobile_sessions"
  }
  override_constant: users_table {
    value: "mobile_users"
  }
}
  • You can then reference the views and dashboards in your model by including the files from the local dependency:
connection: "<your_connection_name>"

include: "//snowplow_block/views/*.view.lkml"
include: "//snowplow_block/dashboards/*.lookml"
  • The LookML dashboards assume a model name of snowplow_mobile_looker. If your model name is different your should override the model_name constant.
  override_constant: model_name {
    value: "<my_model_name>"
  }
  • Depending on how frequently you run the Snowplow Mobile V1 model, or how often you want to refresh the data in Looker, you may want to adjust the datagroup parameter within the model file. Please refer to Looker's doc on datagroups for more information.

Using as a remote_dependency

  • Include this repository as a remote dependency in a new or existing project within your Looker instance.
  • Overwrite the connection constant in the manifest file to the database connection where your Snowplow data lives.
project_name: "<your_project_name>"

remote_dependency: snowplow_block {
  url: "https://github.com/snowplow/looker-snowplow-mobile"
  ref: "main"
  override_constant: connection {
    value: "<your_connection_name>"
  }
}
  • Verify that the table and schema names, defined in the manifest file, aligns with the table names in your database. If you are using the snowlow-mobile dbt package you will most likely need to update these. Overwrite these if that is not the case.
remote_dependency: snowplow_block {
  url: "https://github.com/snowplow/looker-snowplow-mobile"
  override_constant: connection {
    value: "<your_connection_name>"
  }
  override_constant: schema {
    value: "derived"
  }
    override_constant: screen_views_table {
    value: "mobile_screen_views"
  }
    override_constant: sessions_table {
    value: "mobile_sessions"
  }
  override_constant: users_table {
    value: "mobile_users"
  }
}
  • You can then reference the views and dashboards in your model by including the files from the remote dependency:
connection: "<your_connection_name>"

include: "//snowplow_block/views/*.view.lkml"
include: "//snowplow_block/dashboards/*.lookml"
  • The LookML dashboards assume a model name of snowplow_mobile_looker. If your model name is different your should override the model_name constant.
  override_constant: model_name {
    value: "<my_model_name>"
  }
  • Depending on how frequently you run the Snowplow Mobile V1 model, or how often you want to refresh the data in Looker, you may want to adjust the datagroup parameter within the model file. Please refer to Looker's doc on datagroups for more information.

For more information on setting up Looker blocks please refer to the Looker docs.

Join the Snowplow community

We welcome all ideas, questions and contributions!

For support requests, please use our community support Discourse forum.

If you find a bug, please report an issue on GitHub.

Copyright and license

The looker-snowplow-mobile block is Copyright 2022 Snowplow Analytics Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.