Articles on: TagFly

How to choose a Product Identifier?

What you will learn

In this article, you will learn:


What is a Product Identifier?


Every tracking event that contains product data — such as View Content, Add to Cart, Initiate Checkout, and Purchase — includes an identifier for each product. This is the value your marketing channels use to recognize which product the event is about. For example, it is sent as content_ids on Facebook, TikTok, Pinterest, and Snapchat, or as item_id on Google Analytics 4 and Google Ads.
Marketing channels match this identifier against the items in your product catalog or feed. This matching is what powers:

  • Catalog/dynamic ads: showing visitors the exact products they viewed or added to cart
  • Product audiences: building retargeting audiences based on product interactions
  • Product-level reporting: attributing revenue and performance to the right catalog items

If the identifier in your events doesn't match the ID in your catalog, the channel cannot connect them — your dynamic ads may show the wrong products or stop delivering, and product reports become inaccurate. That's why choosing the correct Product Identifier is important.
By default, TagFly uses the Shopify Product ID, which works for most stores whose catalogs are synced directly from Shopify. If your catalog uses a different identifier — such as GTIN, MPN, barcode, or an internal SKU — you can change this setting so your events always match your catalog.


When to use Product ID, Variant ID, or Metafield


Product ID

When to use: When your product catalog on the marketing channel uses Shopify Product IDs.

  • This is the default option and recommended for most stores
  • No additional setup is required

Example use case: A store whose catalog is synced directly from Shopify (e.g., via the official Facebook & Instagram or Google & YouTube sales channel), so catalog IDs are Shopify Product IDs.


Variant ID

When to use: When your catalog is built at the variant level and each variant is a separate catalog item.

  • Events will carry the Shopify Variant ID of the purchased/viewed variant
  • Useful for stores where size, color, or other options are advertised as individual products

Example use case: A fashion store running catalog ads where each size/color variant is a separate catalog item.


Metafield

When to use: When your catalog or feed uses a custom identifier that is stored in a product metafield — for example GTIN, MPN, barcode, or an internal SKU. This is common when your catalog is uploaded by a third-party feed app or managed manually.

  • TagFly reads the value of the selected metafield for each product and sends it as the product identifier, in place of the Shopify Product ID

Example use case: A store whose catalog feed is generated by a feed app using GTIN, while Shopify Product IDs are not present in the catalog at all.


Custom ID (template)

When to use: When your catalog IDs are composed of multiple parts, so no single Shopify field matches — most commonly when your Google Merchant Center feed uses composite offer IDs such as shopify_VN_1234567890_9876543210.

  • This option is currently available only for Google Analytics destinations
  • You build the identifier from a template that combines your own static text (prefixes, separators) with tokens:
    • {productId} — the product's numeric ID, falling back to the variant ID when it is missing
    • {variantId} — the variant's numeric ID
    • {sku} — the variant's SKU, falling back to the variant ID when it is empty
    • {targetCountry} — the country of the market the shopper is browsing

Example use case: A store whose Merchant Center feed is generated by the Google & YouTube sales channel, where offer IDs follow the format shopify_{country}_{product ID}_{variant ID}. The template shopify_{targetCountry}_{productId}_{variantId} reproduces this format, so GA4 events match the feed exactly.


How to set up your Product Identifier


  • When you create or edit a destination, move to the Product Identifier section:

  • Select the option that matches your catalog: Product ID (default), Variant ID, or Metafield, Custom ID (template)


If you select Metafield, there are two ways to choose it:
1. Choose from list

  • Select one of your store's product metafields from the dropdown
  • Metafields are displayed as name (namespace.key) — for example: category_2 (test_data.binding_mount)

2. Enter manually

  • Click Enter manually and type the metafield in the format namespace.key — for example: custom.gtin
  • Use this option if your metafield doesn't appear in the list
The metafield value must match the product ID in your channel's catalog exactly. If the values don't match, the channel cannot match events to your products, which may affect your catalog/dynamic ads performance.


If you select Custom ID (template)

  • Enter a Template that combines the available tokens with your own separators or prefixes — for example: shopify_{targetCountry}_{productId}_{variantId}
  • Your template must include at least one of {productId}, {variantId}, or {sku}. Without one, every product would get the same ID, and Merchant Center rejects identifiers that are not unique
  • If your template uses {targetCountry}, select a Default country. It is used when the shopper's market cannot be determined. The value is pre-filled from your shop's registered address — which is not always your primary market — so check it against the market your feed is built for
  • Review the Preview, which shows a sample product rendered with your template. Compare it against a real offer ID in your Merchant Center feed — a misplaced separator is something validation cannot catch


Frequently Asked Questions

  1. Does changing the Product Identifier affect my existing setup?

No. Existing destinations keep using Product ID until you change this setting yourself. The setting applies per destination, so you can use different identifiers for different channels.

  1. My metafield doesn't appear in the list. What should I do?

Use Enter manually and type it in the namespace.key format. Make sure to include the namespace — for example custom.gtin, not just gtin.

  1. Why don't I see the Custom ID (template) option?

Custom ID (template) is currently available only for Google Analytics, Google Ads and Facebook. For other channels, choose between Product ID, Variant ID, and Metafield.


Need help?

If you run into any issues or want help configuring, reach out to the TagFly support team via the in-app chat — we're happy to walk through it with you.

Updated on: 23/07/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!