Skip to main content

Snowplow Mobile Macros

caution

This page is auto-generated from our dbt packages, some information may be incomplete

Snowplow Mobile

Allow Refresh

macros/allow_refresh.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro allow_refresh() %}
{{ return(adapter.dispatch('allow_refresh', 'snowplow_mobile')()) }}
{% endmacro %}

Depends On

Referenced By

App Context Fields

macros/bigquery/context_fields.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro app_context_fields() %}

{% set app_context_fields = [
{'field':'build', 'dtype':'string'},
{'field':'version', 'dtype':'string'}
] %}

{{ return(app_context_fields) }}

{% endmacro %}

Referenced By

App Error Context Fields

macros/bigquery/context_fields.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro app_error_context_fields() %}

{% set app_error_context_fields = [
{'field':'message', 'dtype':'string'},
{'field':'programming_language', 'dtype':'string'},
{'field':'class_name', 'dtype':'string'},
{'field':'exception_name', 'dtype':'string'},
{'field':'file_name', 'dtype':'string'},
{'field':'is_fatal', 'dtype':'boolean'},
{'field':'line_column', 'dtype':'integer'},
{'field':'line_number', 'dtype':'integer'},
{'field':'stack_trace', 'dtype':'string'},
{'field':'thread_id', 'dtype':'integer'},
{'field':'thread_name', 'dtype':'string'}
] %}

{{ return(app_error_context_fields) }}

{% endmacro %}

Referenced By

Bool Or

macros/bool_or.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro bool_or(field) %}

{{ return(adapter.dispatch('bool_or', 'snowplow_mobile')(field)) }}

{% endmacro %}

Referenced By

Cluster By Fields App Errors

macros/cluster_by_fields.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro cluster_by_fields_app_errors() %}

{{ return(adapter.dispatch('cluster_by_fields_app_errors', 'snowplow_mobile')()) }}

{% endmacro %}

Depends On

Referenced By

Geo Context Fields

macros/bigquery/context_fields.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro geo_context_fields() %}

{% set geo_context_fields = [
{'field':('latitude', 'device_latitude'), 'dtype':'float64'},
{'field':('longitude', 'device_longitude'), 'dtype':'float64'},
{'field':('latitude_longitude_accuracy', 'device_latitude_longitude_accuracy'), 'dtype':'float64'},
{'field':('altitude', 'device_altitude'), 'dtype':'float64'},
{'field':('altitude_accuracy', 'device_altitude_accuracy'), 'dtype':'float64'},
{'field':('bearing', 'device_bearing'), 'dtype':'float64'},
{'field':('speed', 'device_speed'), 'dtype':'float64'}
] %}

{{ return(geo_context_fields) }}

{% endmacro %}

Referenced By

Get Device User Id Path Sql

macros/get_path_sql.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro get_device_user_id_path_sql(relation_alias) %}

{{ return(adapter.dispatch('get_device_user_id_path_sql', 'snowplow_mobile')(relation_alias)) }}

{% endmacro %}

Depends On

Referenced By

Get Session Id Path Sql

macros/get_path_sql.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro get_session_id_path_sql(relation_alias) %}

{{ return(adapter.dispatch('get_session_id_path_sql', 'snowplow_mobile')(relation_alias)) }}

{% endmacro %}

Depends On

Referenced By

Mobile Cluster By Fields Screen Views

macros/cluster_by_fields.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro mobile_cluster_by_fields_screen_views() %}

{{ return(adapter.dispatch('mobile_cluster_by_fields_screen_views', 'snowplow_mobile')()) }}

{% endmacro %}

Depends On

Referenced By

Mobile Cluster By Fields Sessions

macros/cluster_by_fields.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro mobile_cluster_by_fields_sessions() %}

{{ return(adapter.dispatch('mobile_cluster_by_fields_sessions', 'snowplow_mobile')()) }}

{% endmacro %}

Depends On

Referenced By

Mobile Cluster By Fields Sessions Lifecycle

macros/cluster_by_fields.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro mobile_cluster_by_fields_sessions_lifecycle() %}

{{ return(adapter.dispatch('mobile_cluster_by_fields_sessions_lifecycle', 'snowplow_mobile')()) }}

{% endmacro %}

Depends On

Referenced By

Mobile Cluster By Fields Users

macros/cluster_by_fields.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro mobile_cluster_by_fields_users() %}

{{ return(adapter.dispatch('mobile_cluster_by_fields_users', 'snowplow_mobile')()) }}

{% endmacro %}

Depends On

Referenced By

Mobile Context Fields

macros/bigquery/context_fields.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro mobile_context_fields() %}

{% set mobile_context_fields = [
{'field':'device_manufacturer', 'dtype':'string'},
{'field':'device_model', 'dtype':'string'},
{'field':'os_type', 'dtype':'string'},
{'field':'os_version', 'dtype':'string'},
{'field':'android_idfa', 'dtype':'string'},
{'field':'apple_idfa', 'dtype':'string'},
{'field':'apple_idfv', 'dtype':'string'},
{'field':'carrier', 'dtype':'string'},
{'field':'open_idfa', 'dtype':'string'},
{'field':'network_technology', 'dtype':'string'},
{'field':'network_type', 'dtype':'string'}
] %}

{{ return(mobile_context_fields) }}

{% endmacro %}

Referenced By

Screen Context Fields

macros/bigquery/context_fields.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro screen_context_fields() %}

{% set screen_context_fields = [
{'field':('id', 'screen_id'), 'dtype':'string'},
{'field':('name', 'screen_name'), 'dtype':'string'},
{'field':('activity', 'screen_activity'), 'dtype':'string'},
{'field':('fragment', 'screen_fragment'), 'dtype':'string'},
{'field':('top_view_controller', 'screen_top_view_controller'), 'dtype':'string'},
{'field':('type', 'screen_type'), 'dtype':'string'},
{'field':('view_controller', 'screen_view_controller'), 'dtype':'string'}
] %}

{{ return(screen_context_fields) }}

{% endmacro %}

Referenced By

Screen View Event Fields

macros/bigquery/unstruct_event_fields.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro screen_view_event_fields() %}

{% set screen_view_event_fields = [
{'field':('id', 'screen_view_id'), 'dtype':'string'},
{'field':('name', 'screen_view_name'), 'dtype':'string'},
{'field':('previous_id', 'screen_view_previous_id'), 'dtype':'string'},
{'field':('previous_name', 'screen_view_previous_name'), 'dtype':'string'},
{'field':('previous_type', 'screen_view_previous_type'), 'dtype':'string'},
{'field':('transition_type', 'screen_view_transition_type'), 'dtype':'string'},
{'field':('type', 'screen_view_type'), 'dtype':'string'}
] %}

{{ return(screen_view_event_fields) }}

{% endmacro %}

Referenced By

Session Context Fields

macros/bigquery/context_fields.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro session_context_fields() %}

{% set session_context_fields = [
{'field':'session_id', 'dtype':'string'},
{'field':'session_index', 'dtype':'integer'},
{'field':'previous_session_id', 'dtype':'string'},
{'field':('user_id', 'device_user_id'), 'dtype':'string'},
{'field':('first_event_id', 'session_first_event_id'), 'dtype':'string'}
] %}

{{ return(session_context_fields) }}

{% endmacro %}

Referenced By

Stitch User Identifiers

macros/stitch_user_identifiers.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro stitch_user_identifiers(enabled, relation=this, user_mapping_relation='snowplow_mobile_user_mapping') %}

{% if enabled and target.type not in ['databricks', 'spark'] | as_bool() %}

-- Update sessions table with mapping
update {{ relation }} as s
set stitched_user_id = um.user_id
from {{ ref(user_mapping_relation) }} as um
where s.device_user_id = um.device_user_id;

{% elif enabled and target.type in ['databricks', 'spark'] | as_bool() %}

-- Update sessions table with mapping
merge into {{ relation }} as s
using {{ ref(user_mapping_relation) }} as um
on s.device_user_id = um.device_user_id
when matched then
update set s.stitched_user_id = um.user_id;

{% endif %}

{% endmacro %}

Referenced By

Was this page helpful?