Skip to content

Commit

Permalink
Update id_lift_measurement.html
Browse files Browse the repository at this point in the history
  • Loading branch information
patmmccann authored Dec 12, 2024
1 parent db6e569 commit f197c0a
Showing 1 changed file with 36 additions and 7 deletions.
43 changes: 36 additions & 7 deletions integrationExamples/gpt/id_lift_measurement.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,20 @@
<title>Measure Lift of Multiple ID Modules</title>
<script>
const FAILSAFE_TIMEOUT = 2000;
const ID_MODULES = ["id1", "id2", "id3"];
const ID_MODULES = [
{
name: "id1",
params: { key1: "value1", key2: "value2" }
},
{
name: "id2",
params: { key3: "value3", key4: "value4" }
},
{
name: "id3",
params: { key5: "value5", key6: "value6" }
}
];
const TREATMENT_RATE = 0.95; // 95% chance to include an ID module
const targetingArray = [];

Expand Down Expand Up @@ -37,17 +50,18 @@
googletag.cmd = googletag.cmd || [];

// Randomly enable each ID module based on dice rolls
ID_MODULES.forEach(id => {
ID_MODULES.forEach(module => {
const isEnabled = Math.random() < TREATMENT_RATE;
targetingArray.push(`${id}:${isEnabled ? 't1' : 't0'}`);
targetingArray.push(`${module.name}:${isEnabled ? 't1' : 't0'}`);

if (isEnabled) {
pbjs.que.push(function () {
pbjs.mergeConfig({
userSync: {
userIds: [
{
name: id,
name: module.name,
params: module.params
}
],
syncDelay: 5000,
Expand Down Expand Up @@ -117,21 +131,36 @@

<h2>Measure Lift of Multiple ID Modules</h2>

<h4>Generated IDs:</h4>
<pre id="ids-div" style="border:1px solid #333; padding:5px; overflow: auto"></pre>

<h4>Generated EIDs:</h4>
<pre id="eids-div" style="border:1px solid #333; padding:5px; overflow: auto"></pre>

<!-- Instructions Section -->
<h3>Instructions</h3>
<ol>
<li>Ensure that the `abg` key is set in GAM targeting. Each value will be a combination of `id1:t0 or t1`, `id2:t0 or t1`, and `id3:t0 or t1`.</li>
<li>Ensure that the `abg` key is definied in GAM targeting with all possible keys. Each value will be a combination of the following six possible key-value pairs:
<ul>
<li><code>id1:t0</code></li>
<li><code>id1:t1</code></li>
<li><code>id2:t0</code></li>
<li><code>id2:t1</code></li>
<li><code>id3:t0</code></li>
<li><code>id3:t1</code></li>
</ul>
</li>
<li>In Google Ad Manager (GAM), create a report with the following setup:
<ul>
<li><strong>Dimensions</strong>: Ad Unit, Key-Value Targeting (`abg`).</li>
<li><strong>Metrics</strong>: Impressions, Clicks, Revenue.</li>
<li><strong>Metrics</strong>: Impressions, Revenue.</li>
<li><strong>Filters</strong>: Include the `abg` key in the report.</li>
</ul>
</li>
<li>Analyze the report for each ID module:
<ul>
<li>Filter by combinations of `t1` (treatment) and `t0` (control) for each ID module (e.g., `id1:t1`, `id1:t0`).</li>
<li>Compare performance metrics (Impressions, Clicks, Revenue) for the `t1` vs. `t0` values.</li>
<li>Compare performance metrics (eg Impressions, Revenue) for the `t1` vs. `t0` values.</li>
<li>Calculate lift for each module using the formula:
<pre>Lift (%) = ((Treatment Metric - Control Metric) / Control Metric) * 100</pre>
Replace "Metric" with the relevant performance metric.
Expand Down

0 comments on commit f197c0a

Please sign in to comment.