The Challenge of Data Anonymization in Amazon Marketing Cloud (AMC)

The Challenge of Data Anonymization in Amazon Marketing Cloud (AMC)

Amazon Marketing Cloud (AMC) is a powerful tool for advertisers seeking in-depth campaign analysis. However, AMC's data anonymization feature, designed to protect user privacy, can sometimes limit the granularity of insights, particularly for smaller user groups. This anonymization process replaces specific user data with generic values, making it difficult to identify individual user behavior. In regions with stringent privacy regulations like the EU's GDPR, this issue is exacerbated, which results in a higher number of NULL values and further obscuring valuable data.

The Impact of GDPR on Data Granularity

The General Data Protection Regulation (GDPR) has a substantial impact on data granularity within AMC, especially for advertisers operating in the EU. GDPR's strict requirements for data anonymization and user consent can result in data being aggregated or masked to protect individual privacy. While this is crucial for compliance, it can also lead to a loss of detail and granularity in the data. We suspect a GDPR-related impact in EU instances, as we’re seeing nearly 10x more NULL values compared to US instances.

Our Solution: We Revised Default Queries

To overcome the challenge of data anonymization and preserve data granularity, it's necessary to revisit and revise the default queries provided in Amazon’s library. By optimizing these queries, advertisers can extract more meaningful insights from their data without compromising user privacy.

WITH IMPRESSIONS_CTE AS (
      SELECT
        USER_ID,
        ARRAY_TO_STRING(ARRAY_SORT(COLLECT(DISTINCT AD_PRODUCT_TYPE)), ',') AS EXPOSURE_GROUP,
        -- MIN(IMPRESSION_DT) AS MIN_IMPRESSION_DT,
        SUM(COST_MICROCENTS) AS COST_MICROCENTS
      FROM
        (
          SELECT
            I.USER_ID,
            'DSP' AS AD_PRODUCT_TYPE,
            -- I.IMPRESSION_DT,
            I.total_cost * 1000 as COST_MICROCENTS
          FROM
            DSP_IMPRESSIONS I
          WHERE
            I.total_cost > 0
            AND I.impression_date BETWEEN '%1$s' and '%2$s'
          UNION ALL
          SELECT
            I.USER_ID,
            I.AD_PRODUCT_TYPE,
            -- I.EVENT_DT AS IMPRESSION_DT,
            I.spend as COST_MICROCENTS
          FROM
            SPONSORED_ADS_TRAFFIC I
          WHERE
            I.spend > 0
            AND I.event_date BETWEEN '%1$s' and '%2$s'
        )
      GROUP BY
        1
    )
    SELECT
      EXPOSURE_GROUP,
      COST,
      USERS_PURCHASED AS USERS_THAT_PURCHASED,
      AD_EXPOSED_USERS AS UNIQUE_REACH,
      TOTAL_PURCHASES AS TOTAL_PURCHASES,
      TOTAL_PRODUCT_SALES AS TOTAL_PRODUCT_SALES
    FROM (
        SELECT
          I.EXPOSURE_GROUP as EXPOSURE_GROUP,
          0 AS COST,
          COUNT(DISTINCT P.USER_ID) AS USERS_PURCHASED,
          0 AS AD_EXPOSED_USERS,
          SUM(P.total_purchases_clicks) AS TOTAL_PURCHASES,
          SUM(P.total_product_sales_clicks) AS TOTAL_PRODUCT_SALES
        FROM
          AMAZON_ATTRIBUTED_EVENTS_BY_TRAFFIC_TIME P
          FULL OUTER JOIN IMPRESSIONS_CTE I ON I.USER_ID = P.USER_ID
        WHERE
          P.TOTAL_PURCHASES > 0
          AND P.click_date BETWEEN '%1$s' and '%2$s'
          -- for AMAZON_ATTRIBUTED_EVENTS_BY_TRAFFIC_TIME conversion events may have occurred up to 30 days.
          -- 7 days for SP
          AND ((ad_product_type = 'sponsored_products' AND SECONDS_BETWEEN (click_dt, conversion_event_dt) <= 604800)
          -- 14 days otherwise
          OR (ad_product_type <> 'sponsored_products' AND SECONDS_BETWEEN (click_dt, conversion_event_dt) <= 1209600))
          -- MIN_IMPRESSION_DT can't be used due to FULL OUTER JOIN
          --  AND CONVERSION_EVENT_DT > MIN_IMPRESSION_DT
        GROUP BY
          1
       UNION ALL
        SELECT
          EXPOSURE_GROUP,
          SUM(COST_MICROCENTS) / (1000*1000*100) as COST,
          0 AS USERS_PURCHASED,
          COUNT(DISTINCT USER_ID) AS AD_EXPOSED_USERS,
          0 as TOTAL_PURCHASES,
          0 as TOTAL_PRODUCT_SALES
        FROM
          IMPRESSIONS_CTE
        GROUP BY
          1
        )
  

How Advertisers Can Act on those Insights:

  • Refine Ad Strategy: Use the overlap analysis to optimize both DSP and Sponsored Ads campaigns, ensuring that resources are focused where they matter most.
  • Boost ROI: By tracking total purchases and product sales from ad exposure, advertisers can adjust their campaigns to maximize returns on their ad spend.
  • Optimize Targeting: Understanding the reach of your ads—especially in smaller groups—can help you better target specific customer segments.

Conclusion

Data anonymization in Amazon Marketing Cloud is essential for user privacy, but it can pose challenges for advertisers seeking granular insights. With this revised query, you can ensure that your data is as complete as possible without compromising privacy. Contact us to learn more about how this query can benefit you.

m19 logo
Tarik Berrada Hmima
February 13, 2025
Subscribe to our newsletter!

We will constantly share insightful articles about Amazon ads with you.