Case Study: Implementing Advanced Bing Ads Conversion Tracking for Ago Lab Nutraceutica on Shopify

This case study details the successful implementation of a custom Bing Ads purchase tracking solution for Ago Lab Nutraceutica, an Italian-based pharmaceutical company specializing in high-quality health supplements.

Client: Ago Lab Nutraceutica
My Role: Web Analyst
Platform: Shopify
Core Tools: Google Tag Manager (GTM), Bing Ads, Custom JavaScript


Executive Summary

As the Web Analyst for Ago Lab Nutraceutica, I was tasked with resolving a critical marketing data gap: the inability to accurately track Bing Ads conversions on their Shopify store. Due to Shopify’s platform updates deprecating key tracking functionalities, standard methods were no longer viable. I developed and implemented a custom JavaScript solution using Shopify’s “Customer Events” and Google Tag Manager. This restored full conversion tracking, enabling accurate Return on Ad Spend (ROAS) calculation and data-driven campaign optimization for Bing Ads.

The Challenge: The Shopify Tracking Blackout

Ago Lab Nutraceutica relies on multiple digital advertising channels to drive sales, with Bing Ads being a key component of their marketing mix. The primary challenge stemmed from a significant technical change within the Shopify platform: the deprecation of the additional_scripts field in the checkout.liquid file.

This change created a major obstacle for tracking third-party conversions:

  1. Broken Tracking Pixels: Standard implementations for platforms like Bing Ads, which required placing a tracking script on the final checkout/thank-you page, were no longer functional.
  2. Loss of Conversion Data: Without a working conversion pixel, it was impossible to attribute sales directly to Bing Ads campaigns, ad groups, or keywords.
  3. Inability to Measure ROI: The marketing team could not calculate the Return on Ad Spend (ROAS) for their Bing Ads budget, making it impossible to justify or scale their investment.
  4. Impeded Optimization: Campaign optimization became reliant on guesswork rather than performance data. We couldn’t identify which ads were successful or which to pause.

The core problem was to find a robust, future-proof method to capture detailed purchase data (transaction ID, revenue, currency, items) and send it to Bing Ads from a restricted Shopify environment.

My Role & The Solution

As the lead Web Analyst on this project, my responsibility was to design and implement a technical solution to restore this crucial tracking capability. My approach involved leveraging modern platform features to bypass the limitations of the old system.

The solution was executed in three key phases:

Phase 1: Leveraging Shopify’s Customer Events

Instead of attempting a workaround for the deprecated additional_scripts, I utilized Shopify’s newer, more robust Customer Events feature. This is Shopify’s recommended method for securely running custom scripts on the post-purchase page. It provides reliable access to checkout and customer data in a structured format.

Phase 2: Developing a Custom JavaScript for Data Layer Injection

I wrote a custom JavaScript snippet specifically for the “Checkout Completed” event “Purchase” Customer Event. This script was engineered to perform the following actions:

  • Access Shopify’s Data Object: Securely tap into the shopify.checkout data object made available on the thank-you page.
  • Extract Key Variables: Pull dynamic purchase information, including order.id, order.totalPrice.amount, order.currencyCode, and details of the products purchased.
  • Push to Google Tag Manager’s Data Layer: Format the extracted data and push it into the dataLayer using a custom event name (e.g., bing_purchase). This step is critical as it decouples the website’s code from the marketing tags, allowing for flexible management within GTM.

Phase 3: Configuring Google Tag Manager

With the data now successfully being sent to the dataLayer on every purchase, the final step was to configure GTM to capture this data and send it to Bing Ads.

  1. Data Layer Variables: I created variables in GTM to capture each piece of pushed information (e.g., dlv – transaction_id, dlv – transaction_revenue).
  2. Custom Trigger: I set up a Custom Event Trigger that would fire only when the bing_purchase event was pushed to the dataLayer.
  3. Bing Ads UET Tag: I configured a Bing Ads Universal Event Tracking (UET) tag.
    • Event Type: Set to “Purchase.”
    • Trigger: Fired on the bing_purchase custom trigger.
    • Dynamic Values: Used the GTM variables to dynamically populate the event parameters for Revenue, Currency, and Order ID.

This setup ensured that the Bing Ads tag fired only on successful purchases and was populated with accurate, dynamic transaction data.

Results and Impact

The implementation of this custom solution delivered immediate and significant results for Ago Lab Nutraceutica’s marketing efforts:

  • Restored 100% Tracking Accuracy: Bing Ads began receiving accurate conversion data for every purchase, providing a clear view of campaign performance.
  • Enabled Accurate ROAS Measurement: The marketing team could finally measure the precise Return on Ad Spend, allowing them to make informed decisions about budget allocation.
  • Data-Driven Campaign Optimization: With visibility into which campaigns and keywords were driving sales, the team was empowered to optimize bids, pause underperforming ads, and scale successful ones.
  • Future-Proof & Secure Solution: By using Shopify’s officially supported “Customer Events” feature, the tracking solution is stable, secure, and compliant with the platform’s best practices, reducing the risk of it breaking during future Shopify updates.

Conclusion

This project demonstrates the ability to solve complex web analytics challenges within restrictive e-commerce ecosystems like Shopify. By combining a deep understanding of platform-specific features (Shopify Customer Events), JavaScript, and tag management systems (GTM), I was able to build a resilient and effective tracking infrastructure that directly translated into measurable business value for Ago Lab Nutraceutica.

🚀 Unlock Your Ad Tracking Potential!

Struggling with broken conversion tracking on Shopify? Let me help you restore data accuracy, optimize ROAS, and scale your campaigns with a custom solution tailored to your needs.

Scroll to Top