Skip to content

fivetran/dbt_apple_store

Repository files navigation

Apple Store dbt Package

This dbt package transforms data from Fivetran's Apple Store connector into analytics-ready tables.

Resources

What does this dbt package do?

This package enables you to better understand your Apple App Store metrics at different granularities and provides intuitive reporting at the App Version, Platform Version, Device, Source Type, Territory, Subscription and Overview levels. It creates enriched models with metrics focused on aggregating all relevant application metrics into each of the reporting levels.

Output schema

Final output tables are generated in the following target schema:

<your_database>.<connector/schema_name>_apple_store

Final output tables

By default, this package materializes the following final tables:

Table Description
apple_store__app_version_report Tracks daily App Store metrics by app version and source type including crashes, active devices, installations, deletions, and sessions to monitor version performance and identify version-specific issues.

Example Analytics Questions:
  • Which app versions have the highest active devices and session counts?
  • How do crash rates compare across different app versions and source types?
  • Which app versions have the most installations versus deletions?
apple_store__device_report Analyzes daily App Store metrics by device type and source including downloads, crashes, impressions, sessions, and subscription counts across different subscription types to optimize device-specific experiences.

Example Analytics Questions:
  • Which devices have the most total downloads and active devices by source type?
  • How do crash rates and session counts vary across different device types?
  • Which devices have the highest subscription counts across free trial versus standard price subscriptions?
apple_store__overview_report Provides a comprehensive daily summary of App Store performance including downloads, active devices, sessions, crashes, page views, and subscription counts across all subscription types to monitor overall app health.

Example Analytics Questions:
  • What are the daily trends in total downloads, active devices, and sessions?
  • How do first-time downloads compare to redownloads over time?
  • What is the distribution of active subscriptions across free trial, pay-as-you-go, pay-up-front, and standard price types?
apple_store__platform_version_report Monitors daily App Store metrics by platform version and source type including downloads, crashes, impressions, active devices, and sessions to ensure platform compatibility and prioritize platform version support.

Example Analytics Questions:
  • Which platform versions have the most active devices and highest session counts?
  • How do crash rates vary across different platform versions and source types?
  • What percentage of downloads come from the newest versus older platform versions?
apple_store__source_type_report Analyzes daily App Store performance by acquisition source type including downloads, impressions, page views, active devices, sessions, installations, and deletions to measure channel effectiveness and optimize marketing spend.

Example Analytics Questions:
  • Which source types generate the most first-time downloads and total downloads?
  • How do impressions and page views convert to downloads by source type?
  • What is the ratio of installations to deletions for organic versus paid source types?
apple_store__subscription_report Tracks daily subscription counts by product, territory, and state across different subscription types (free trial, pay-as-you-go, pay-up-front, standard) to analyze subscription performance and geographic distribution.

Example Analytics Questions:
  • Which subscription products and territories have the highest active subscription counts?
  • How do subscription counts vary by state and subscription type (free trial vs standard)?
  • What is the geographic distribution of pay-as-you-go versus pay-up-front subscriptions?
apple_store__territory_report Monitors daily App Store metrics by territory and source type including downloads, impressions, page views, active devices, sessions, installations, and deletions to understand regional performance and optimize regional marketing.

Example Analytics Questions:
  • Which territories have the highest total downloads and active devices by source type?
  • How do impressions and page views vary across different regions and sub-regions?
  • What territories show the strongest performance for organic versus paid acquisition?

¹ Each Quickstart transformation job run materializes these models if all components of this data model are enabled. This count includes all staging, intermediate, and final models materialized as view, table, or incremental.


Prerequisites

To use this dbt package, you must have the following:

  • At least one Fivetran Apple Store connection syncing data into your destination.
  • A BigQuery, Snowflake, Redshift, PostgreSQL, or Databricks destination.

How do I use the dbt package?

You can either add this dbt package in the Fivetran dashboard or import it into your dbt project:

  • To add the package in the Fivetran dashboard, follow our Quickstart guide.
  • To add the package to your dbt project, follow the setup instructions in the dbt package's README file to use this package.

Install the package

Include the following apple_store package version in your packages.yml file:

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

packages:
  - package: fivetran/apple_store
    version: [">=1.3.0", "<1.4.0"]

All required sources and staging models are now bundled into this transformation package. Do not include fivetran/apple_store_source in your packages.yml since this package has been deprecated.

Define database and schema variables

Option A: Single connection

By default, this package runs using your destination and the apple_store schema. If this is not where your Apple Store data is (for example, if your Apple Store schema is named apple_store_fivetran), add the following configuration to your root dbt_project.yml file:

vars:
    apple_store_database: your_destination_name
    apple_store_schema: your_schema_name

Option B: Union multiple connections

If you have multiple Apple Store connections in Fivetran and would like to use this package on all of them simultaneously, we have provided functionality to do so. For each source table, the package will union all of the data together and pass the unioned table into the transformations. The source_relation column in each model indicates the origin of each record.

To use this functionality, you will need to set the apple_store_sources variable in your root dbt_project.yml file:

# dbt_project.yml

vars:
  apple_store:
    apple_store_sources:
      - database: connection_1_destination_name # Required
        schema: connection_1_schema_name # Required
        name: connection_1_source_name # Required only if following the step in the following subsection

      - database: connection_2_destination_name
        schema: connection_2_schema_name
        name: connection_2_source_name

Previous versions of this package employed two separate, mutually exclusive variables for unioning: apple_store_union_schemas and apple_store_union_databases. While these variables are still supported, apple_store_sources is the recommended variable to configure.

Optional: Incorporate unioned sources into DAG

If you use Fivetran Transformations for dbt Core™ and are unioning multiple Apple Store connections, you can define your sources in a property .yml file, using this as a template. Set the variable has_defined_sources: true under the Apple Store namespace in your dbt_project.yml. Otherwise, your Apple Store connections won't appear in your DAG. See the union_connections macro documentation for full configuration details.

Disable models for non-existent sources

Your Apple App Store connection might not sync every table that this package expects. If you use subscriptions and have the sales_subscription_event_summary and sales_subscription_summary tables synced, add the following variable to your dbt_project.yml file:

vars:
  apple_store__using_subscriptions: true # by default this is assumed to be false

Seed country_codes mapping table (once)

In order to map longform territory names to their ISO country codes, we have adapted the CSV from lukes/ISO-3166-Countries-with-Regional-Codes to align with Apple's country output format.

You will need to dbt seed the apple_store_country_codes file just once.

(Optional) Additional configurations

Expand/collapse configurations

Defining subscription events

By default, Subscribe, Renew and Cancel subscription events are included and required in this package for downstream usage. If you would like to add additional subscription events, please add the below to your dbt_project.yml:

    apple_store__subscription_events:
    - 'Renew'
    - 'Cancel'
    - 'Subscribe'
    - '<additional_event_name>'
    - '<additional_event_name>'

Change the build schema

By default, this package builds the apple_store staging models within a schema titled (<target_schema> + apple_store_source) and your apple_store modeling models within a schema titled (<target_schema> + _apple_store) in your destination. If this is not where you would like your apple_store data to be written to, add the following configuration to your root dbt_project.yml file:

models:
    apple_store:
      +schema: my_new_schema_name # Leave +schema: blank to use the default target_schema.
      staging:
        +schema: my_new_schema_name # Leave +schema: blank to use the default target_schema.

Change the source table references

If an individual source table has a different name than the package expects, add the table name as it appears in your destination to the respective variable:

IMPORTANT: See this project's dbt_project.yml variable declarations to see the expected names.

vars:
    apple_store_<default_source_table_name>_identifier: your_table_name 

Source casing for case-sensitive destinations

By default, the package applies case-insensitive comparisons when resolving source_relation values. If your destination is case-sensitive and you want downstream transformations to respect the exact casing of your source database and schema names, set the following variable:

vars:
    fivetran_using_source_casing: true

(Optional) Orchestrate your models with Fivetran Transformations for dbt Core™

Expand for details

Fivetran offers the ability for you to orchestrate your dbt project through Fivetran Transformations for dbt Core™. Learn how to set up your project for orchestration through Fivetran in our Transformations for dbt Core™ setup guides.

Does this package have dependencies?

This dbt package is dependent on the following dbt packages. These dependencies are installed by default within this package. For more information on the following packages, refer to the dbt hub site.

IMPORTANT: If you have any of these dependent packages in your own packages.yml file, we highly recommend that you remove them from your root packages.yml to avoid package version conflicts.

packages:
    - package: fivetran/fivetran_utils
      version: [">=0.4.0", "<0.5.0"]

    - package: dbt-labs/dbt_utils
      version: [">=1.0.0", "<2.0.0"]

    - package: dbt-labs/spark_utils
      version: [">=0.3.0", "<0.4.0"]

How is this package maintained and can I contribute?

Package Maintenance

The Fivetran team maintaining this package only maintains the latest version of the package. We highly recommend you stay consistent with the latest version of the package and refer to the CHANGELOG and release notes for more information on changes across versions.

Contributions

A small team of analytics engineers at Fivetran develops these dbt packages. However, the packages are made better by community contributions.

We highly encourage and welcome contributions to this package. Learn how to contribute to a package in dbt's Contributing to an external dbt package article.

Opinionated Decisions

In creating this package, which is meant for a wide range of use cases, we had to take opinionated stances on a few different questions we came across during development. We've consolidated significant choices we made in the DECISIONLOG.md, and will continue to update as the package evolves. We are always open to and encourage feedback on these choices, and the package in general.

Are there any resources available?

  • If you have questions or want to reach out for help, see the GitHub Issue section to find the right avenue of support for you.
  • If you would like to provide feedback to the dbt package team at Fivetran or would like to request a new dbt package, fill out our Feedback Form.

About

Fivetran's Apple App Store source dbt package

Topics

Resources

License

Stars

1 star

Watchers

41 watching

Forks

Packages

 
 
 

Contributors