Amazon Marketing Cloud
Overview
The Amazon Marketing Cloud (AMC) app integration allows advertisers using Amazon Advertising to pass CDP segments of advertiser audiences from Treasure Data (TD) in pseudonymized form. AMC combines Amazon Ads signals across advertising channels to provide custom analytics on topics such as media impact, audience segments, and customer journeys while maintaining customer privacy.
Use Cases
- Audience overlap: Understand the overlap between Treasure Data audiences and those engaged with their Amazon Ads campaigns.
- Audience attributes: Assess the Amazon audience segments that contains your Treasure Data audiences.
- Off-Amazon ad impact: Measure the impact of Amazon Ads campaigns on direct-to-customer engagements and conversions.
- Customer journey: Evaluate customer activities across Amazon Ads channels as well as brand-owned channels such as email and website.
Prerequisites and Limitations
- Ensure that the Amazon Marketing Cloud Segment Enrichment app package is enabled in the TD Marketplace within your tenant.
- You have an existing Audience and Segment within Treasure Data.
- You have an existing Amazon Marketing Cloud instance.
- Configured a connection between your Amazon Marketing Cloud instance and Treasure Data instance. For details, visit Amazon DSP Data Provider Export Integration.
Currently, the Amazon DSP Export Integration has limitations in fully supporting the AMC app. For example, Amazon DSP does not accept hashed emails and can only accept cookies.
- To use Treasure Insights Dashboards created by AMC:
- TD Account must have Treasure Insights enabled.
- TD User installing the package must have Edit Data Models & Dashboards permissions.
- TD User installing the package must have Workflow Edit & Run permissions.
Setup
1. Connect to AMC
To allow-list to your Amazon Marketing Cloud instance with Treasure Data CDP, you must contact your Amazon Advertising Account Executive, or send a request to AMC Support with your Amazon Marketing Cloud instance ID and confirm that you would like to connect to Treasure Data CDP. After this request is successfully processed, Treasure Data CDP can connect to your Amazon Marketing Cloud instance on a recurring basis.
By filing this submission, you will be replacing access for any existing connections to your Amazon Marketing Cloud instance using an allow-list method. If you have questions about this, contact your TD Account Executive or Amazon Marketing Cloud Support.
2. Configure Treasure Data Info
- API Key: A master API key from your Treasure Data Account.
- API Endpoint: A specific endpoint for you TD instance. For example, api.treasuredata.com, which can be obtained at endpoints.
- Email to Assign Datamodels To: Initial owner to assign data model access for Insights Models created by the app.
3. Configure CDP Info
- Audience Id: ID of the Audience.
- Segment Id: ID of the segment within the audience.
- Cdp Endpoint: The API endpoint of your CDP instance, which can be found here at endpoints.
4. Configure AMC Info
- Amazon Marketing Cloud Instance Endpoint: (Provided by your Amazon Marketing Cloud rep) For example:
https://xxxxxxx.execute-api.us-east-1.amazonaws.com/prod
- Data Upload AWS Account ID: The ID of the Amazon Marketing Cloud Instance’s data upload AWS account. This can be provided by your Account Executive or Amazon Marketing Cloud support.
- You may refer to the following screenshot for an example of where to find the required IDs in the Amazon Marketing Cloud UI:
- The Amazon Marketing Cloud instance ID is found in the URL (highlighted).
- The Amazon Marketing Cloud API endpoint and Data Upload AWS Account ID are found in the Tasks section.
Installed Components
After the app has completed installation, the following components are installed.
Database / Tables
- amc_upload_db.amc_log_table: Stores event logs from interactions with Amazon Marketing Cloud API.
- amc_upload_db.amc_upload_segment_segment_id: Segments exported to Amazon Marketing Cloud are stored in this database with the the naming convention
amc_upload_segment_segment_segment_id
. For example, segment id 12345 would be a tableamc_upload_segment_12345
in the databaseamc_upload_db
. - amc_results_db.queryname_segment_segment_id: Results from Amazon Marketing Cloud workflows are stored in this database with the the naming convention
queryname_segment_<segment_id>
. For example, segment id12345
and query / workflow nameoverall_1p_user_match
would be a tableoverall_1p_user_match_segment_157460
in the databaseamc_upload_db
. - amc_results_db.segment_matchrate: Stores matchrate of uploaded segments.
Queries
- queries/amc_log_table_check_logs.sql: Check logs of app events.
- queries/check_s3_to_amc_upload_status.sql: Check status of uploads from s3 to Amazon Marketing Cloud instance.
- queries/check_workflowExecutionId.sql: Check status of workflow executions.
Workflows
- amc_marketplace_app_v1.dig: Main workflow that starts steps to get segment information and creates dataset on Amazon Marketing Cloud.
- amc_run_adhoc_query.dig: Run adhoc query or workflow on Amazon Marketing Cloud.
- get_s3_to_amc_upload_status.dig: Runs every 30 minutes using query
queries/check_s3_to_amc_upload_status.sql
to check status of uploads of segment information from S3 to Amazon Marketing Cloud instance. If successful upload ID is found, workflow is created and executed on Amazon Marketing Cloud and aworkflowExecutionId
is saved. - get_workflow_status.dig: Runs every 30 mins using
queries/check_workflowExecutionId.sql
to check status of workflow executions based onworkflowExecutionId
. IfworkflowExecutionId
status is succeeded and results contain data, results will be uploaded intoamc_results_db database
with the naming convention<workflow_id>_segment_<segment_id>
. Insights Datamodel will be created with a naming conventionamc_workflowId_segment_<segmentId>
. For example, workflowsbx_dsp_impressions
and segment157460
would create datamodelamc_sbx_dsp_impressions_segment_157460
.
Tasks
Create Dataset / Upload Advertiser Data (1p) to AMC
The Amazon Marketing Cloud marketplace package only uploads hashed emails for matching with Amazon Marketing Cloud. Ensure that your segments include an email field. This gets hashed by the AMC Segment Enrichment app.
- Get the Audience and Segment ID of the segment that you would like to upload to Amazon Marketing Cloud. You can get these from viewing the segment URL in Audience Studio v5. For example: https://console-next.treasuredata.com/app/ps/252594/e/157460/sb/da. In this instance, the Audience ID is the number after
ps
: 252594 and the segment ID is after/e/
: 157460.
- Open the
amc_marketplace_app_v1.dig
workflow. - Modify the
config.yml
file to insert theaudienceId
andsegmentId
of the segment you would like to upload. - Run the
amc_marketplace_app_v1.dig
workflow. - When the workflow ends,
uploadId
will be visible in the logs. - The
get_s3_to_amc_upload_status.dig
runs every 30 mins to update the status of uploads of datasets / 1p data to Amazon Marketing Cloud. - You can check the upload ID using the
queries/check_s3_to_amc_upload_status.sql
query to check the status of the upload. - You can confirm the data is uploaded to your Amazon Marketing Cloud instance by checking under the Advertiser Uploaded section for the uploaded data.
Create and Run Query/Workflow on Amazon Marketing Cloud
- Edit the
amc_run_adhoc_query.dig
file. - Edit the following parameters: dataSetId: segment_${segment_id}
- **dataSetId:** segment_${segment_id}
- ${segment_id} value is found in the `config.yml` file.
- **queryName:** overall_1p_conversion
- Select the query name for the query you would like to run from the list of queries in the `sample_queries.yml` file.
- **Query:** ${overall_1p_conversion}
- Enter the queryname between the ${xxxx}.
- **timeWindowStart:** "2022-09-05T00:00:00"
- The start time of the time window period.
- **timeWindowEnd:** "2022-09-14T00:00:00"
- The end time of the time window period.
- **timeWindowType:** 'EXPLICIT'
- Specifies the label for time window period as predefined by AMC API. For details, refer to Amazon API documentation.
- **timeWindowTimeZone:** 'UTC'
- The time zone.
- When you have edited the parameters as required, save and commit the
amc_run_adhoc_query.dig
file. - Run the
amc_run_adhoc_query.dig
file. - Logs for workflow run should end with the pending status of workflow and the parameters should match those entered in previous step.
- Workflow run logs will include
workflowExecutionId
. For example,20ba9649-08fc-4daa-8dd4-bfd95b595bf3
. - Your Amazon Marketing Cloud workflow is now in
PENDING
status. - The
get_workflow_status.dig
workflow runs every 30 mins to check and update the status ofworkflowExecutionId
. - You can run the
queries/check_workflowExecutionId.sql
query to check if the app has any pendingworkflowExecutionId
.
- When the
get_workflow_status.dig
workflow runs, it checks the status of theworkflowExecutionId
. When workflow completes, the data is uploaded into the databaseamc_results_db
with table named with the conventionqueryname_segment_<segment_id>
.
- When workflow execution completes, a datamodel is created with a naming convention
amc_queryname_segment_<segment_id>
.
View Amazon Marketing Cloud Workflow Results
- The results from the Amazon Marketing Cloud workflows are loaded into tables in the
amc_results_db
database with table named with the convention<queryname_segment_<segment_id>
.
- Datamodels from workflow results are created with the naming convention
amc_queryname_segment_<segment_id>
.