Stape
Search
Try for free

Google Merchant Center Lookup variable for Google Tag Manager server container

Updated
Sep 10, 2024
Published
Sep 5, 2024

Google Merchant Center Lookup variable is used to retrieve and enrich product data by querying information from a Google Merchant Center account. This is particularly useful for enhancing the data associated with products in your Merchant Center, such as product categories or additional attributes, when passing data to other systems like Google Ads or Google Analytics via the server-side GTM container.

Use case

For example, you’re an e-commerce company that uses Google Merchant Center to manage your product catalog and Google Ads to run Shopping campaigns. You want to track conversions and product interactions more accurately by enriching product data in the server-side Google Tag Manager (GTM) container before sending it to Google Analytics or Google Ads for reporting and optimization.

When users interact with the website, product-related data (such as product categories, brands, and other custom attributes) may not always be fully captured client-side. Some attributes might be missing from the web data layer or poorly categorized due to inconsistencies in product tagging on the front end. This results in incomplete or inaccurate data being sent to Google Ads and Analytics, potentially affecting campaign performance and reporting.

By setting up Google Merchant Center Lookup variable in the GTM server container, you can enrich the data related to product interactions by pulling additional details directly from your Google Merchant Center feed. This ensures that the product information sent to Google Ads and Analytics is accurate and consistent across all platforms.

Benefits

  • Consistent Data Across Platforms: Merchant Center Lookup ensures that all platforms (Google Ads, Analytics, etc.) are working with the same, up-to-date product information.
  • Improved Campaign Performance: Google Ads and other platforms can optimize campaigns better when they receive complete and accurate data about the products being sold.
  • Automation and Efficiency: by automating the product data lookup via the server container, the company reduces manual work and the risk of inconsistencies due to human error.
  • Enhanced Reporting: the enriched data allows for better tracking of product interactions and conversions, leading to more detailed insights for optimization.

The initial development of this template was done by Lars Friis, and it is now maintained by Stape.

How it works

Google Merchant Center Lookup variable for Google Tag Manager server container
  • Items (input to be enriched)

This is where you specify the item or product data you want to enrich from your Google Merchant Center account. You would typically select an existing variable or data layer property here.

  • Merchant center ID

This is where you input your Google Merchant Center account ID, which the variable will use to look up product information.

  • Cache (hours)

Defines how long the data fetched from the Merchant Center is stored in the cache. For example, if set to 12 hours, the fetched data will be stored for 12 hours before it is updated with new information.

  • Feed language

The language of the product feed that the lookup will pull from. This field ensures that the data matches the correct language of the Merchant Center feed.

Find parameter in merchant center url: feedLabel=DK

  • Feed label

This allows you to specify which feed within your Merchant Center account to use, particularly if you have multiple feeds for different purposes.

Find parameter in merchant center url: language=da

  • Map product_types into item_categories checkbox

If checked, this option maps the product_type in the Merchant Center to the item_category field in GTM. This can help categorize products in a more structured way for reporting or targeting.

  • Basic Mapping

This allows for simple mappings between Google Merchant Center Lookup variables and GTM variables. You can add rows here to map specific attributes from your Merchant Center to variables in GTM.

  • Custom Mapping

This is for more advanced or complex mappings where you want to manually map specific attributes or variables between the Merchant Center and GTM.

How to set up Google Merchant Center Lookup variable

2. Download Google Merchant Center Lookup variable on GitHub.

Google Merchant Center Lookup variable for Google Tag Manager server container

3. Import the variable to server Google Tag Manager container by clicking: Templates → New Variable Template. 

Click three dots in the top right corner → Click import → Add template that you’ve recently downloaded → Click Save.

Google Merchant Center Lookup variable for Google Tag Manager server container

4. Fill in the data in the fields of the variable. Click Save.

And you’re all done!

Conclusion

Google Merchant Center Lookup variable enriches product data in Google Tag Manager by pulling attributes from a Google Merchant Center feed, making it useful for server-side tracking, dynamic remarketing, or other applications where you need detailed product information.

We hope you find this guide helpful and if you have any questions, please feel free to leave a ticket or ask any questions in the comments section.

Tagged with:gtm server

Host your GTM server at Staperight now!