👉 Take me there! 👈
Core Web Vitals Custom Module
This custom module is built as an extension of the dbt-snowplow-web package, it transforms raw
To enable this optional module, the web package must be correctly configured. Please refer to the snowplow-web dbt quickstart guide for a full breakdown of how to set it up.
In order to use this module you would need to:
- Track core web vitals using the web
Snowplow Web Vitals plugin, which populates the column/table
- Have the yauaa enrichment enabled (for device type and device class), which populates
- (Ideally, but not necessarily) Have the spiders and bots enrichment enabled, which populates
This custom module consists of a series of dbt models which produce the following aggregated models from the raw web vitals events:
snowplow_web_vitals: Incremental table used as a base for storing core web vital events (first event per page view).
snowplow_web_vital_measurements: Drop and recompute table to use for visualizations that takes core web vital measurements at the user specified percentile point (defaulted to 75).
It is assumed that the dbt_snowplow_web package is already installed and configured as per the Quick Start instructions.
Enable the module
You can enable the custom module through the
snowplow__enable_cwv variable in your
Override the module specific macros
For information about overriding our macros, see here
core_web_vital_page_groups()source macro is used to let the user classify their urls to specific page groups. It returns the sql to provide the classification (expected in the form of case when statements).
core_web_vital_results_query()source macro is used to let the user classify the tresholds to be applied for the measurements. It returns the sql to provide the logic for the evaluation based on user defined tresholds (expected in the form of case when statements).
Please make sure you set the results you would like the measurements to pass to
good or align it with the
case when lcp_result = 'good' and fid_result = 'good' and cls_result = 'good' then 1 else 0 end passed
Run the module
If you have previously run the web model without this optional module enabled, you can simply enable the module and run
dbt run --selector snowplow_web as many times as needed for this module to catch up with your other data. If you only wish to process this from a specific date, be sure to change your
snowplow__start_date, or refer to the Custom module section for a detailed guide on how to achieve this the most efficient way.
If you haven't run the web package before, then you can run it using
dbt run --selector snowplow_web either through your CLI, within dbt Cloud, or for Enterprise customers you can use the BDP console. In this situation, all models will start in-sync as no events have been processed.