How to Use Page URL as ecomm_prodid for Dynamic Remarketing

Dynamic Remarketing Using Page URL as Product ID

I’m assisting a website owner in implementing dynamic remarketing. Since the website lacks a data layer, I plan to utilize the product page path as a unique identifier for the products. The remarketing tag is set to fire exclusively on pages with a specific URL format for product details views. I’ve deployed the remarketing tag through Google Tag Manager (GTM) and manually defined custom parameters, such as ecomm_prodid and ecomm_pagetype, using the page path information.

Do I need to create a new product feed that uses the page path as the index value for the products? Additionally, can I integrate this new feed as a supplementary feed alongside the main feed?

The short answer is:

Where should a non-retail business upload a custom feed that uses the page URL as the product ID for dynamic remarketing in Google Ads?

Yes, you absolutely need to create a new product feed where the ID attribute is the exact value you are extracting from the page path in GTM, which you are using for your ecomm_prodid parameter.

You can and should integrate this custom feed as a supplementary feed alongside your main feed in Google Merchant Center, but only if your main feed is for Shopping Ads and uses a different product identifier (like SKU or internal ID).

If you are not a retail business using Merchant Center, you would simply upload this custom feed directly to the Business Data section of Google Ads.

The principle remains the same: the ID sent in the tag must match the ID in the feed perfectly.

The long answer is:

Your solution of using the page path as the product identifier is a clever workaround when a proper data layer is missing, but its success is entirely dependent on a perfect match between the value in the tag and the value in the feed.

When Google Ads receives the dynamic remarketing event (like view_item) with the custom parameter ecomm_prodid set to a specific URL path fragment, it uses that exact string to look up the product details (image, price, title, link) from your connected product feed.

If there is a mismatch, the dynamic ad will fail to serve personalized content.

Therefore, you must create a dedicated feed where the primary ID column contains the exact string value you are extracting from the page path in GTM.

For example, if your GTM variable extracts /product/blue-widget-456 and uses it for ecomm_prodid, your feed must have a row where the ID is also /product/blue-widget-456.

You have a couple of options for the feed depending on your business type.

If you are a retailer selling physical goods, you should use Google Merchant Center.

Your original product feed for Shopping Ads likely uses standard identifiers like SKU or GTIN for its id column.

Because you cannot change the primary id of that feed without potentially breaking your Shopping campaigns, you should create your custom URL-based feed and upload it as a supplementary feed to Merchant Center.

The key here is that the supplementary feed uses a different attribute, often a custom_label_0 to custom_label_4 or display_ads_id, for its own linking or segmentation, but for dynamic remarketing to work, the IDs must match.

The best way to use the supplementary feed in this scenario is to use Merchant Center feed rules to map your main product feed’s link attribute to your dynamic remarketing ID column if the link is a full URL, or to map the page path to the ID if you can extract it there.

If you are a non-retail business (e.g., travel, services, education, or custom), you should upload your feed directly to the Business Data section of Google Ads.

You would simply use the custom feed you created, with the page path as the ID, and link that business data feed to your dynamic remarketing campaign.

A better, more future-proof, and low-cost solution is to leverage the Google Ads API for server-side remarketing and audience management, particularly if you’re comfortable with GTM Server Container.

By implementing server-side tagging via GTM Server Container and a service like Stape or Google Cloud Platform, you can send the product view events and their IDs to the server.

You then use the Google Ads API to send audience and conversion data directly from your server environment to Google Ads.

This is an excellent solution because it’s much more reliable and resilient to client-side issues like ad blockers and browser privacy restrictions.

Instead of struggling with the data layer, you can use your server to process the URL path into the clean ID and push it directly into the GTM Server Container’s data stream, which then fires a high-quality, dependable Google Ads remarketing tag.

This server-side infrastructure is surprisingly cheap to run using Stape’s managed services or a basic GCP setup, and it provides a level of data control and accuracy that is simply impossible with client-side GTM alone.

This process shifts the complex data extraction from the visitor’s browser to your own reliable server environment.

About The Author