Skip to main content
A mobile gaming company has rapidly grown to 2 million users but knows very little about who those users are. Since the game doesn’t require account registration, they lack basic demographic information needed for effective ad targeting and audience insights. Through Narrative, they can enrich their user base with age and gender data from identity providers, then automate monthly refreshes for new users.

What you will build

This cookbook walks through creating a demographic enrichment pipeline that:
  1. Uploads a seed dataset of mobile advertising IDs (MAIDs) from your customer base
  2. Matches those MAIDs against demographic data providers using Rosetta Stone
  3. Enriches records with raw age values (not pre-bucketed segments) and gender
  4. Automates recurring enrichment for new users added each month
The result is a continuously refreshed customer dataset with demographic attributes that you own outright and can use across any platform.

Prerequisites

Before starting, ensure you have:
  • A dataset of customer identifiers (MAIDs, hashed emails, or other supported identifier types)
  • Access to demographic data through data collaboration or marketplace providers
  • Familiarity with NQL syntax
  • Understanding of materialized views
  • Understanding of Mobile Ad IDs

Step 1: Upload your seed dataset

First, upload your customer identifier file to Narrative. This dataset serves as the seed list you want to enrich. Your dataset should include at minimum:
  • A unique identifier column (MAID, hashed email, etc.)
  • An identifier type column if you have mixed identifier types
Example schema for a MAID-based seed file:
Upload your seed dataset through the Narrative UI or SDK. Map the identifier column to the unique_identifier Rosetta Stone attribute for identity matching.

Normalize identifiers with Rosetta Stone

Ensure your identifier column is mapped to Rosetta Stone’s unique_identifier attribute:

Step 2: Identify available demographic sources

Query the Rosetta Stone to understand which demographic attributes are available across your data collaborations:
This shows you the identifier types and demographic coverage across available providers.

Step 3: Match and enrich with demographics

Create a materialized view that joins your seed dataset with demographic data through Rosetta Stone identity matching.
Key patterns used:
Unlike pre-bucketed audience segments (e.g., “25-34”), Rosetta Stone provides raw age values. This gives you flexibility to create your own segments, perform precise analytics, or build custom targeting strategies.

Step 4: Handle multiple demographic observations

A single identifier may have demographic data from multiple sources or observation times. To get the most recent or most common value:

Most recent observation

Consensus across sources

When you want the most common demographic value across multiple providers:

Step 5: Automate incremental enrichment

For growing customer bases, create an incremental view that only processes new users added since the last refresh.

Create an incremental seed view

First, identify new users not yet in your enriched dataset:

Enrich and merge new users

Use WRITE_MODE = 'append' for incremental views that add new records to an existing dataset without overwriting historical data.

Step 6: Create audience segments

With enriched demographics, create targetable audience segments:

Age-based segments

Gender-specific segments


Summary

You have built a demographic enrichment pipeline with these components:

Use cases

  • Media targeting: Reach specific demographic segments with relevant creative
  • Audience analytics: Understand the composition of your customer base
  • Lookalike modeling: Build seed audiences based on demographic profiles
  • Personalization: Tailor app experiences or content by age group
  • Attribution: Analyze conversion rates across demographic segments

Key advantages

Raw values, not buckets

Receive exact age values instead of pre-defined segments, giving you flexibility to create custom ranges

Omni-use license

Data is enriched once and can be used across any platform or use case without per-use fees

Automated refresh

Monthly schedules keep your enriched data current as new users join

Transparent sourcing

See which providers contribute demographic data and evaluate match quality

Important considerations

MAID availability: iOS App Tracking Transparency and Android privacy changes have reduced MAID availability. Consider supplementing with hashed email or other identifier types for broader coverage. See Mobile Ad IDs for details.
Privacy compliance: Demographic data may be subject to GDPR, CCPA, and other privacy regulations depending on source and use case. Ensure your enrichment workflow complies with applicable requirements. See CCPA compliance and GDPR compliance for details.

Joining Datasets

Learn JOIN patterns for enrichment queries

Creating Materialized Views

Step-by-step guide to automated views

Mobile Ad IDs

Understanding IDFA, GAID, and privacy considerations

Data Onboarding

Connecting offline data to digital identifiers