![image](https://hackmd.io/_uploads/S1YLsM8lkg.png) # Powergram.nl | Measurement plan | Developer Instructions | Web. This measurement plan contains an overview of all data(points) we advise to collect on your platform. These are supplemented with code snippet instructions aimed at developers who play an important role in the measurement setup. As not all data is available on the page initially, we ask developers to prepare this and provide the necessary data when certain interaction events take place. Our goal is to deploy an error-proof setup which is not prone to changes in the DOM of the website. Therefore we strive to collect as much data as possible made available through back- and frontend data streams. Every part of the measurement plan is structured by an ‘if’, ‘then’, ‘whereby’ structure that explains the exact moment data needs to be made available. ## [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Table-of-Contents "Table-of-Contents")Table of Contents <span class="toc"></span> ## [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Other-events "Other-events")Main events ### Add_to_cart <span style="font-weight: 700;">If</span> the user clicked "Starting immediately": <span style="font-weight: 700;">Then</span> the following dataLayer has to be filled: ``` <script> window.dataLayer = window.dataLayer || []; dataLayer.push({ 'event': 'add_to_cart', 'ecommerce': { 'currency': 'EUR', // The currency of the product 'value': 249.00, // The total value of the items in the cart 'items': [{ 'item_name': 'Instagram Groei Service', // The name of the product 'item_variant': 'Premium', // Product variant, e.g., 'Standard', 'Premium' 'item_category': 'Subscriptions', // The category of the product 'price': 249.00, // The price of a single unit of the product 'subscription_type': 'monthly' // Custom dimension for subscription type }] } }); </script> ``` <span style="font-weight: 700;">Screenshot</span> https://prnt.sc/RWIRBKiapF3U OR https://prnt.sc/KHdXJx_Hapoi --- ### Begin_checkout <span style="font-weight: 700;">If</span> started checkout, fill in all required fields and click "Afrekenen" <span style="font-weight: 700;">Then</span> the following dataLayer has to be filled: ``` <script> window.dataLayer = window.dataLayer || []; dataLayer.push({ 'event': 'begin_checkout', 'ecommerce': { 'currency': 'EUR', // The currency of the transaction 'value': 249.00, // The total value of all items in the cart. Use a number, not a string. 'items': [{ 'item_name': 'Instagram Groei Service', // The name of the product 'item_variant': 'Premium', // Product variant, e.g., 'Standard', 'Premium' 'item_category': 'Subscriptions', // The category of the product 'price': 249.00, // The price of a single unit of the product 'quantity': 1, // The number of units 'subscription_type': 'monthly' // A custom dimension for subscription type }] } }); </script> ``` <span style="font-weight: 700;">Screenshot</span> https://prnt.sc/NjC3nhm20CSe --- ### Purchase <span style="font-weight: 700;">If</span> the product was successfully paid for: <span style="font-weight: 700;">Then</span> the following dataLayer has to be filled: ``` <script> window.dataLayer = window.dataLayer || []; dataLayer.push({ 'event': 'purchase', 'ecommerce': { 'transaction_id': 'T_12345', // The unique ID of the transaction 'value': 249.00, // The total value of the purchase 'currency': 'EUR', // The currency of the transaction 'items': [{ 'item_name': 'Instagram Groei Service', // The name of the product 'item_variant': 'Premium', // Product variant, e.g., 'Standard', 'Premium' 'item_category': 'Subscriptions', // The category of the product 'price': 249.00, // The price of a single unit of the product 'quantity': 1, // The number of units purchased 'subscription_type': 'monthly', // A custom parameter for subscription type 'payment_method': 'creditcard' // The payment method used }] } }); </script> ``` <span style="font-weight: 700;">Screenshot</span> --- ## [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Contact-for-Questions "Contact-for-Questions")Contact for Questions <div class="alert alert-info" style="font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, &quot;Helvetica Neue&quot;, Helvetica, Roboto, Arial, sans-serif; font-size: 16px; letter-spacing: 0.35px; margin-bottom: 0px !important;"> <span style="font-weight: 700;">For all the questions regarding the measurement plan please reach out to:</span> Muslim Karaiev - muslimkaraev83@gmail.com </div>