<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Saptaswa Pal on Medium]]></title>
        <description><![CDATA[Stories by Saptaswa Pal on Medium]]></description>
        <link>https://medium.com/@saptaswapal96?source=rss-5579908e6da6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LAAq2SBA_5JyofwADa1igw.jpeg</url>
            <title>Stories by Saptaswa Pal on Medium</title>
            <link>https://medium.com/@saptaswapal96?source=rss-5579908e6da6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 20:32:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@saptaswapal96/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Sharing near real-time insights of a live campaign using Google’s Ads Data Hub]]></title>
            <link>https://medium.com/miq-tech-and-analytics/sharing-dynamic-insights-of-a-live-campaign-with-ads-data-hub-google-data-studio-b340d7e20a75?source=rss-5579908e6da6------2</link>
            <guid isPermaLink="false">https://medium.com/p/b340d7e20a75</guid>
            <category><![CDATA[google-ads]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[programmatic]]></category>
            <category><![CDATA[data-clean-room]]></category>
            <category><![CDATA[hub]]></category>
            <dc:creator><![CDATA[Saptaswa Pal]]></dc:creator>
            <pubDate>Thu, 27 May 2021 07:38:46 GMT</pubDate>
            <atom:updated>2021-05-28T10:42:33.031Z</atom:updated>
            <content:encoded><![CDATA[<h3>Sharing Near Real-Time Insights Of A Live Campaign Using Google’s Ads Data Hub</h3><h4>Understanding the privacy features whilst running the query at a particular frequency in Ads Data Hub</h4><h3>Introduction</h3><p>In our previous <a href="https://medium.com/miq-tech-and-analytics/deeper-data-integration-with-an-advertiser-leveraging-googles-ads-data-hub-af313d1b1cdb">blog</a>, we had introduced and explained the importance of Google’s privacy-centric data warehouse solution — <a href="https://developers.google.com/ads-data-hub">Ads Data Hub</a> (ADH). ADH provides a clean room environment in which advertisers can continue to use their data modeling capabilities within Google’s walled garden and also acquire insights to help optimize the campaign.</p><p>Nevertheless, ADH isn’t an ideal data warehouse solution. Its privacy-centric nature can cause issues in obtaining dynamic insights for a live campaign if the objective is to refresh the data after every 2 or 3 days. We, at MiQ, needed to come up with a solution to get granular insights on a live campaign using ADH data sources and also refresh the data for the insights after a particular frequency. In this blog, we will try to understand the issues faced and the need for a discrete solution.</p><h3>Privacy Checks in ADH</h3><p>Each time we write a query in ADH, and to set the context in this blog, we need to keep in mind the 3 <a href="https://developers.google.com/ads-data-hub/guides/privacy-checks">privacy checks</a> provided by ADH i.e:</p><ol><li><strong>Static Privacy Check — </strong>This helps with the immediate noticeable privacy concern in our queries even before we can run it using ADH UI or API (instant exception thrown).</li><li><strong>Aggregation Privacy Check — </strong>This ensures that every row from the ADH query result includes enough users to protect the end-user privacy. For most queries, we only receive aggregated data on 50 or more users. However, queries that retrieve clicks and conversions can be used to aggregate on 10 or more users. Any row that doesn’t follow the aggregation check gets filtered out.</li><li><strong>Differential Privacy Check — </strong>This prevents us from gathering information about individual users by running the same query multiple times for a close or overlapping date range thereby preventing comparison of the data from the multiple sets of users. So when any query tries to aggregate the same set of users in simultaneous jobs at a particular level (Let’s say, date level aggregation!!), then a few rows may get filtered out in our current job and may not appear in the result set unless we mention the ‘<em>Filtered Row Summary’</em> for our query.</li></ol><p>Since Ads Data Hub writes the results to a BigQuery (BQ) table, sometimes we may want to transform those results into a presentable format before sharing them with our teams/clients. This can be done by:-</p><ul><li>Either, directly sharing the BQ table if the output data from the ADH query already serves the desired granularity.</li><li>Or, by visualizing the data from the BQ table in a Data Visualization or Business Intelligence Tool.</li></ul><p>Here comes <a href="https://marketingplatform.google.com/about/data-studio/">Google Data Studio</a> (GDS), which serves as a great data visualization tool being part of Google Marketing Platform (GMP). It helps in building interactive dashboards, and customized, beautiful reporting. We, at MiQ, use GDS to track key KPIs for clients, visualize trends, and compare performance over time. For keeping this blog short and concise, we will not be discussing GDS any further.</p><h3>What’s an ideal way to gain insights on a campaign using ADH?</h3><p><em>Running an ADH query once &amp; getting results in BigQuery</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JWWpzEhLmWyIKcfF" /><figcaption>Figure 1: Ideal flow for data visualization from ADH</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/0*ntFI9uIHqQ_EB6H9" /><figcaption>Figure 2: BQ Table for insights on line-items (Job 1)</figcaption></figure><p>Let’s start by understanding a basic scenario (Figure 1). Imagine you are an Ad Agency running a campaign for a client/advertiser, and the advertiser’s DV360 account is linked to your ADH account. For the campaign, you have created a single insertion order (IO) with a set of 5 line items (LI) and you want to get insights on all the 5 line items (Figure 2) by writing an ADH query. The ADH-DV360 data sources could be used as shown in Figure 3 to help create the required query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FOeHzUG5rrTsGKoIr8xfxg.png" /><figcaption>Figure 3: ADH Query</figcaption></figure><p>Also, it’s always a good practice to mention a <a href="https://developers.google.com/ads-data-hub/guides/filtered-row-summary"><em>Filtered Row Summary</em></a> (FRS) before we execute our Query. In this case, to specify the FRS, <em>‘line_item’ </em>and <strong><em>‘</em></strong><em>line_item_id’</em> can be kept as - <em>‘Constant’</em>, and <em>‘impressions’</em>, <em>‘conversions’ </em>and <em>‘media_cost’ </em>can be kept as - <em>‘Sum’. </em>Once your ADH query execution is completed and the data is dumped in BQ, from where it can be easily rendered in the GDS dashboard using the BQ connector.</p><p><em>Voila!! </em>Now, this was quite straightforward as it was a one-time job, and if you are lucky enough none of the rows will get filtered out due to aggregation checks.</p><h3>How to refresh the data in the BigQuery table for dynamic insights?</h3><p><em>Running an ADH query with a refresh frequency &amp; getting results in BigQuery</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qWE2A6TC-TWqQya0" /><figcaption>Figure 4: BQ Table for insights on line-items (Job 2)</figcaption></figure><p>Now let’s consider another scenario where we need to schedule the previously explained ADH query and pull the latest data in the BigQuery table frequently.</p><h4>Understanding the problem statement</h4><p>Let’s try by running the same query, that we wrote above, the next day and you may get the result something similar to Figure 4. Now if we try to acquire insights using this BQ table, will be quite misleading. So, what is it that went wrong in your 2nd run where three of the line items didn’t show up individually and instead got filtered?</p><h4>What caused the problem?</h4><p>This is because ADH isn’t an ideal data warehouse solution where the data could just be queried and retrieved. In the 2nd job scenario, due to differential privacy checks, ADH may have detected some vulnerabilities on the level of individual users when comparing a job’s results to previous results, as there may be a large number of overlapping users, and hence few line items get filtered out. Common blockers users face at this point:</p><ul><li>Data getting filtered out at each subsequent run leaving with few or zero rows in the output table.</li><li>If the same query is run multiple times, the user may get blocked from running those queries for some time (usually 6–7 hrs, which could increase case-wise).</li></ul><h4>How did we solve the problem?</h4><p>At this moment we understand the limitations of retrieving data from the same ADH query by running it multiple times. So, what can be done to get near real-time data for insights on a live campaign with a refresh frequency of 2 or 3 days and get most data out from the filtered row summary?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*S1VxYovsvW2WFWUg" /><figcaption>Figure 5: Data Flow Architecture</figcaption></figure><p>We, at MiQ, tried solving this limitation by including a separate<strong> </strong><em>data flow architecture</em><strong> </strong>(Figure 5) in our workflow <em>from the 2nd run onwards</em>.</p><ol><li>Let’s start by terming the BQ table from the <em>1st run</em>, as the <strong>Master Table</strong>. We start by backing up the Master Table from the 1st run or the previous run in a new Table, called <strong>Backup Table</strong>.</li><li>Next, we continue to run the same ADH query with a <em>start date as the Day 1 of the campaign</em> and <em>the</em> <em>end date being the last valid day in the calendar</em> (yesterday), which will populate the result in a new table, called <strong>Temporary Table</strong>.</li><li>Then, we will truncate the complete Master table and write all the rows from the Temporary Table in it.</li><li>The next step is to insert rows from the Backup Table with any unique rows (unique line items in our case) which may have been filtered out in the Temporary Table due to privacy checks.</li></ol><p>Now, the <em>final Master table in the 2nd run</em> may look something similar to Figure 6, which has backfilled the missing line items.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lvdEWZjTHv-EVS_c" /><figcaption>Figure 6: BQ table insight on line-items as per the new architecture</figcaption></figure><h4>Commonly Suggested Alternative</h4><p>Questions may arise that, why not perform a union of the table from the current run (running the query for only fresh days instead of running it from Day 1) and previous run and then the group at <em>‘line_item’ </em>and <em>‘line_item_id’</em> level and simply add up all dimensions and recalculate the metrics?</p><p>The explanation is quite simple.</p><p>Let say if <em>‘Line Item ID 3’</em> gets filtered in the 2nd run. So that particular data will be part of the Filtered Row Summary. Then the same line-item reappears in the 3rd run, following which you may just add up the dimensions like ‘<em>impressions’</em>, ‘<em>conversions’,</em> and ‘<em>media_cost’</em>. <strong>Now, this data will be misleading because the data for that line item doesn’t include figures from the 2nd run</strong>. So the idea of just grouping the data and summing up the dimensions is not a good one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/0*z5oIK3T3LXBH44--" /><figcaption>Figure 7: BQ table insights on date-level</figcaption></figure><p>Though the above argument for running the ADH query for the last 1 or 2 days instead of running it from Day 1 of the campaign, may work better when we are trying to get insights for a particular date.</p><p>Let say we already have an ADH query and a master table with date level trends from 1st-3rd Jan ’21. Now we want to get the data for the 4th &amp; 5th Jan, then we could try running the ADH query for only those 2 days and then merge the result to the master table (Figure 7).</p><p>Then, the date level insights would also help us with some other level (eg: <em>‘day of week’</em> level) insights, which could be a discussion for another time!! :)</p><h4>Conclusion</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bgYUszfQ9yJ59oiR" /><figcaption>Figure 8: Data Studio Dashboard using the master table</figcaption></figure><p>The above-suggested solution in all our future runs can make sure all the new rows are updated and rows that aren’t updated will have the data from the previous runs. This gives us another insight on the rows, which aren’t updating for a long time is that the line items may be performing poorly or may have been deactivated. The above flow will help in getting the most details by running the same ADH query with a particular frequency. Even if the rows are filtered out we would have a snapshot of old data to be shown in the dashboard.</p><p>The master table (Figure 6) which gets refreshed after each run can be used in the Data Studio dashboard (Figure 8) for tracking client’s KPI and visualizing trends. Each time the master table is refreshed we can refresh the dashboard to render the fresh data (highlighted in <strong>red</strong>). Upon which important decisions can be made between the campaign to optimize the same to improve performance and, hence, maximize profits.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b340d7e20a75" width="1" height="1" alt=""><hr><p><a href="https://medium.com/miq-tech-and-analytics/sharing-dynamic-insights-of-a-live-campaign-with-ads-data-hub-google-data-studio-b340d7e20a75">Sharing near real-time insights of a live campaign using Google’s Ads Data Hub</a> was originally published in <a href="https://medium.com/miq-tech-and-analytics">MiQ Tech and Analytics</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>