What you will build
This cookbook walks through creating a demographic enrichment pipeline that:- Uploads a seed dataset of mobile advertising IDs (MAIDs) from your customer base
- Matches those MAIDs against demographic data providers using Rosetta Stone
- Enriches records with raw age values (not pre-bucketed segments) and gender
- Automates recurring enrichment for new users added each month
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
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’sunique_identifier attribute:
Step 2: Identify available demographic sources
Query the Rosetta Stone to understand which demographic attributes are available across your data collaborations:Step 3: Match and enrich with demographics
Create a materialized view that joins your seed dataset with demographic data through Rosetta Stone identity matching.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
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.
Related content
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

