Skip to main content

Snowplow Ecommerce Macros

caution

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

Snowplow Ecommerce

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_ecommerce')()) }}
{% endmacro %}

Depends On

Referenced By

Cart Fields

macros/bigquery/context_fields.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro cart_fields() %}

{% set cart_fields = [
{'field': 'cart_id', 'dtype': 'string'},
{'field': ('currency', 'cart_currency'), 'dtype': 'string'},
{'field': ('total_value', 'cart_total_value'), 'dtype': 'numeric'},
] %}

{{ return(cart_fields) }}

{% endmacro %}

Referenced By

Checkout Step Fields

macros/bigquery/context_fields.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro checkout_step_fields() %}

{% set checkout_step_fields = [
{'field': ('step', 'checkout_step_number'), 'dtype': 'integer'},
{'field': ('account_type', 'checkout_account_type'), 'dtype': 'string'},
{'field': ('billing_full_address', 'checkout_billing_full_address'), 'dtype': 'string'},
{'field': ('billing_postcode', 'checkout_billing_postcode'), 'dtype': 'string'},
{'field': ('coupon_code', 'checkout_coupon_code'), 'dtype': 'string'},
{'field': ('delivery_method', 'checkout_delivery_method'), 'dtype': 'string'},
{'field': ('delivery_provider', 'checkout_delivery_provider'), 'dtype': 'string'},
{'field': ('marketing_opt_in', 'checkout_marketing_opt_in'), 'dtype': 'boolean'},
{'field': ('payment_method', 'checkout_payment_method'), 'dtype': 'string'},
{'field': ('proof_of_payment', 'checkout_proof_of_payment'), 'dtype': 'string'},
{'field': ('shipping_full_address', 'checkout_shipping_full_address'), 'dtype': 'string'},
{'field': ('shipping_postcode', 'checkout_shipping_postcode'), 'dtype': 'string'}
] %}

{{ return(checkout_step_fields) }}

{% endmacro %}

Referenced By

Coalesce Columns By Prefix

macros/bigquery/coalesce_columns_by_prefix.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro coalesce_columns_by_prefix(model_ref, col_prefix) %}
{% set all_column_objs = snowplow_utils.get_columns_in_relation_by_column_prefix(model_ref, col_prefix) %}
{% set all_column_names = all_column_objs|map(attribute='name')|list %}
{% set joined_paths = all_column_names|join(', ') %}
{% set coalesced_field_paths = 'coalesce('~joined_paths~')' %}

{{ return(coalesced_field_paths) }}
{% endmacro %}

Depends On

Referenced By

Event Name Filter

macros/event_name_filter.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro event_name_filter(event_names) %}

{%- if event_names|length -%}

lower(event_name) in ('{{ event_names|map("lower")|join("','") }}') --filter on event_name if provided

{%- else -%}

true

{%- endif -%}

{% endmacro %}

Referenced By

Snowplow Ecommerce Delete From Manifest

macros/snowplow_delete_from_manifest.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro snowplow_ecommerce_delete_from_manifest(models) %}
{{ snowplow_utils.snowplow_delete_from_manifest(models, ref('snowplow_ecommerce_incremental_manifest'))}}
{% endmacro %}

Depends On

Tracking Action Fields

macros/bigquery/unstruct_event_fields.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro tracking_action_fields() %}

{% set tracking_action_fields = [
{'field': ('type', 'ecommerce_action_type'), 'dtype': 'string'},
{'field': ('name', 'ecommerce_action_name'), 'dtype': 'string'},
] %}

{{ return(tracking_action_fields) }}

{% endmacro %}

Referenced By

Tracking Page Fields

macros/bigquery/context_fields.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro tracking_page_fields() %}

{% set tracking_page_fields = [
{'field': ('type', 'ecommerce_page_type'), 'dtype': 'string'},
{'field': ('language', 'ecommerce_page_language'), 'dtype': 'string'},
{'field': ('locale', 'ecommerce_page_locale'), 'dtype': 'string'},
] %}

{{ return(tracking_page_fields) }}

{% endmacro %}

Referenced By

Transaction Fields

macros/bigquery/context_fields.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro transaction_fields() %}

{% set transaction_fields = [
{'field': 'transaction_id', 'dtype': 'string'},
{'field': ('currency', 'transaction_currency'), 'dtype': 'string'},
{'field': ('payment_method', 'transaction_payment_method'), 'dtype': 'string'},
{'field': ('revenue', 'transaction_revenue'), 'dtype': 'numeric'},
{'field': ('total_quantity', 'transaction_total_quantity'), 'dtype': 'integer'},
{'field': ('credit_order', 'transaction_credit_order'), 'dtype': 'boolean'},
{'field': ('discount_amount', 'transaction_discount_amount'), 'dtype': 'numeric'},
{'field': ('discount_code', 'transaction_discount_code'), 'dtype': 'string'},
{'field': ('shipping', 'transaction_shipping'), 'dtype': 'numeric'},
{'field': ('tax', 'transaction_tax'), 'dtype': 'numeric'},
] %}

{{ return(transaction_fields) }}

{% endmacro %}

Referenced By

User Fields

macros/bigquery/context_fields.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro user_fields() %}

{% set user_fields = [
{'field':('id', 'ecommerce_user_id'), 'dtype':'string'},
{'field':('email', 'ecommerce_user_email'), 'dtype':'string'},
{'field':('is_guest', 'ecommerce_user_is_guest'), 'dtype':'boolean'}
] %}

{{ return(user_fields) }}

{% endmacro %}

Referenced By

Was this page helpful?