Implementing Microsoft Advertising Consent Mode with TRUENDO Consent Management Platform
Introduction#
This guide provides step-by-step instructions on how to implement Microsoft Advertising Consent Mode with the TRUENDO Consent Management Platform (CMP) using Google Tag Manager (GTM). By integrating these tools, you ensure that your Microsoft Advertising Universal Event Tracking (UET) tags respect user consent preferences, maintaining compliance with privacy regulations like GDPR.
Key Objectives:
- Configure Microsoft Advertising UET tags to respect user consent.
- Integrate TRUENDO CMP with Microsoft Advertising Consent Mode.
- Ensure that tracking only occurs when users have given appropriate consent.
1. Prerequisites#
Before you begin, ensure you have the following:
- Microsoft Advertising Account: Access to your UET tag and consent mode documentation.
- TRUENDO CMP Account: TRUENDO CMP installed on your website.
- Google Tag Manager (GTM) Account: Administrative access to your GTM container.
- Basic Understanding of JavaScript: Helpful for customizing code snippets.
2. Understanding the Integration#
Microsoft Advertising Consent Mode allows you to adjust how Microsoft Advertising tags behave based on the user's consent status. When integrated with TRUENDO CMP, you can:
- Control Data Collection: Ensure UET tags only collect data when the user has consented to marketing cookies.
- Maintain Compliance: Align with GDPR and other privacy regulations by respecting user preferences.
- Optimize Advertising Efforts: Collect accurate data for users who have given consent, improving ad targeting and measurement.
Key Components:
- UET Tag: The tracking code provided by Microsoft Advertising.
- Consent Mode Commands: JavaScript commands (
consent
commands) that inform UET about the user's consent status. - TRUENDO CMP Callback: A function that updates UET's consent status based on TRUENDO's consent management.
3. Step-by-Step Implementation Guide#
A. Set Up Microsoft Advertising UET Tag
-
Retrieve Your UET Tag:
- Log in to your Microsoft Advertising account.
- Navigate to Tools > UET Tag.
- If you haven't created a UET tag yet, click "Create UET tag" and follow the prompts.
- Copy the UET tag code provided.
-
Implement UET Tag via GTM:
- In your GTM account, select your container.
- Click on "Tags" in the left-hand menu.
- Click "New" to create a new tag.
- Name the tag (e.g.,
Microsoft UET Tag
). - Choose "Custom HTML" as the tag type.
- Paste the UET tag code into the HTML field.
- Set up appropriate Triggering (e.g., All Pages).
- Save the tag.
B. Create a Custom HTML Tag in GTM
-
Create the Consent Mode Tag:
- Click on "Tags" and then "New" to create a new tag.
- Name the tag (e.g.,
Microsoft Consent Mode
).
-
Configure the Tag:
-
Select "Custom HTML" as the tag type.
-
Paste the following code into the HTML field:
<script> window.uetq = window.uetq || []; window.uetq.push('consent', 'default', { 'ad_storage': 'denied' }); </script> <script> function TruendoCookieControlCallback(cookieObj) { if (cookieObj.marketing) { window.uetq.push('consent', 'update', { 'ad_storage': 'granted' }); } else { window.uetq.push('consent', 'update', { 'ad_storage': 'denied' }); } } </script>
-
Explanation:
- The first script sets the default consent state to 'denied' before any user interaction.
- The
TruendoCookieControlCallback
function updates the consent status based on the user's choice. - When the user consents to marketing cookies,
ad_storage
is set to 'granted'; otherwise, it's set to 'denied'.
-
-
Set Up Triggering:
- Choose a Trigger that fires on all pages, similar to the UET tag.
- Note: This tag must fire before the UET tag.
-
Save the Tag:
- Click "Save" to save the custom HTML tag.
C. Adjust Tag Firing Order in GTM
-
Set Tag Sequencing:
- Open your UET Tag in GTM.
- Scroll down to the "Advanced Settings" section.
- Expand "Tag Sequencing".
- Check the box for "Fire a tag before [Your UET Tag] fires".
- In the dropdown, select your "Microsoft Consent Mode" tag.
- Optional: Check "Prevent [UET Tag] from firing if [Consent Mode Tag] fails" to ensure that the UET tag doesn't fire if the consent mode tag encounters an error.
-
Save Changes:
- Click "Save" to update the UET tag with the new sequencing settings.
D. Implement TRUENDO CMP
-
Ensure TRUENDO CMP is Installed:
- Verify that the TRUENDO CMP script is correctly installed on your website.
- The script should be placed according to TRUENDO's integration guidelines.
-
Confirm Callback Functionality:
- The
TruendoCookieControlCallback
function in the custom HTML tag will automatically be called by TRUENDO when the user's consent status changes.
- The
-
No Additional Changes Needed:
- Since the callback function is included in the custom HTML tag, no further action is required for integration.
4. Testing and Verification#
To ensure everything works correctly:
-
Publish Changes in GTM:
- In GTM, click "Submit" and publish your container changes.
-
Clear Browser Cookies:
- Clear cookies related to your website to reset any previous consent states.
-
Access Your Website:
- Navigate to your website in a browser.
-
Test Without Consent:
- Action: Decline marketing cookies in the TRUENDO consent banner.
- Expected Result: Microsoft UET should not collect or store any advertising data.
- Verification: Use browser developer tools to check that no requests are sent to Microsoft Advertising endpoints (e.g.,
bat.bing.com
).
-
Test With Consent:
- Action: Accept marketing cookies in the TRUENDO consent banner.
- Expected Result: Microsoft UET should function normally and collect data.
- Verification: Use browser developer tools to confirm that requests are being sent to Microsoft Advertising endpoints.
-
Check Console Logs (Optional):
-
Add
console.log
statements in your custom HTML tag for debugging purposes.if (cookieObj.marketing) { console.log('Marketing consent granted.'); window.uetq.push('consent', 'update', { 'ad_storage': 'granted' }); } else { console.log('Marketing consent denied.'); window.uetq.push('consent', 'update', { 'ad_storage': 'denied' }); }
-
Observe the console to verify that the correct messages appear based on consent status.
-
5. Additional Considerations#
-
Consent Defaults:
- The default consent state is set to 'denied' to ensure no data is collected before the user provides consent.
-
Script Loading Order:
- It's crucial that the Consent Mode Tag fires before the UET tag to set the appropriate consent state.
-
Data Privacy Compliance:
- Always ensure that your implementation complies with relevant data protection laws and regulations.
-
GTM Best Practices:
- Keep your GTM workspace organized by naming tags, triggers, and variables clearly.
- Regularly review and audit your tags for accuracy and compliance.
6. Troubleshooting#
Common Issues:
-
UET Tag Still Collects Data Without Consent:
- Cause: The Consent Mode Tag may not be firing before the UET tag.
- Solution: Verify tag sequencing in GTM to ensure the correct order.
-
JavaScript Errors in Console:
- Cause: Syntax errors in the custom HTML tag.
- Solution: Review the code for typos or missing characters.
-
Consent Callback Not Triggering:
- Cause: TRUENDO CMP may not be properly installed, or the callback function isn't recognized.
- Solution: Ensure TRUENDO CMP is correctly implemented and that the callback function is defined as shown.
Steps to Resolve:
-
Use GTM Preview Mode:
- Utilize GTM's Preview and Debug mode to test tag firing and sequencing.
-
Check Network Requests:
- In browser developer tools, monitor network requests to
bat.bing.com
to see if UET data is being sent.
- In browser developer tools, monitor network requests to
-
Consult Documentation:
- Refer to Microsoft Advertising and TRUENDO documentation for additional guidance.
7. Conclusion#
By following this guide, you have successfully integrated Microsoft Advertising Consent Mode with TRUENDO CMP using GTM. This implementation ensures that:
- User Consent is Respected: UET tags only collect data when users have consented to marketing cookies.
- Compliance is Maintained: Aligns with GDPR and other privacy regulations.
- Advertising Data is Accurate: Improves the quality of data collected for advertising purposes.
8. Support and Resources#
-
Microsoft Advertising Support:
-
TRUENDO Support:
- Email: support@truendo.com
-
Google Tag Manager Resources:
End of Guide
If you have any further questions or need additional assistance, please feel free to ask!