When you use WPML to translate WooCommerce products into multiple languages, each product translation has its own unique SKU and product ID. This can cause confusion in Facebook’s product catalog, especially for dynamic ads and tracking.
To solve this, you can create a unified SKU ID that combines your product SKU with the original product ID, ensuring Facebook can reliably identify products across translations.
Here’s how to do it with Product Feed Elite using a simple code snippet.
Why Combine SKU with Product ID?
- SKUs alone might be duplicated or translated inconsistently across languages.
- Facebook’s catalog needs a unique and consistent ID for each product.
- Combining SKU with the original (main language) product ID ensures uniqueness.
- Helps Facebook correctly track, match, and optimize ads for your products regardless of language.
The Solution: Add Unified SKU ID for Facebook Feed
How It Works:
- Trigger Condition: The code only runs for Facebook’s dynamic remarketing feed (facebook_drm).
- Original Product ID: It gets the original product ID for any translated product using WPML’s API.
- SKU Combination: If the product has an SKU, it creates a new sku_id by joining the SKU and the original product ID with an underscore _.
- Result: The feed outputs a unique SKU ID per product that stays consistent across all translations.
Why This Helps You
- Ensures unique and stable product IDs for Facebook, even with multiple languages.
- Prevents SKU duplication or conflicts when translations use similar SKUs.
- Supports better ad performance by providing Facebook with clear, consistent product identifiers.
- Makes your dynamic ads and catalogs cleaner and easier to manage.
How to Use This Code
1. Paste the code in your child theme’s functions.php or use a plugin like WPCode.
2. Confirm you have WPML and Product Feed Elite active.
3. Regenerate your Facebook product feed.
4. Verify that your feed now includes a new field called sku_id combining SKU and product ID.
For WooCommerce stores with WPML, adding a unified SKU ID to your Facebook product feeds is a simple but powerful way to keep your multilingual products well-organized and uniquely identifiable. This helps Facebook optimize your ads and catalog management, improving your marketing results.