Main issue: Set the Facebook Pixel’s product ID to the SKU via Open Graph meta tags on product pages in a Shopify theme.
Problem: The initial implementation mixed non-Liquid/PHP-style code (e.g., $product->get_sku(‘view’)) into a Liquid template and returned an incorrect ID in Facebook’s debugger. A screenshot was referenced but not essential to the fix.
Solution provided: Update meta-tags.liquid to use Shopify Liquid variables and the current product variant’s SKU.
Compute og_* values and og_type based on request.page_type.
Derive availability (og_stock) from product.available.
Set product:retailer_item_id to {{ current_variant.sku }} and product:availability accordingly.
I’ve been trying since a while to fix the Facebook pixel issue, After research I found that setting the SKU as an ID should fix this - if this is not correct please Do tell -
Now, to set the SKU as an ID and get the Facebook pixel correctly installed
I’ve the following code from the Social-Meta-Tag.liquid
(
{% if request.page_type == 'product' %}
)
It’s all about the last line, which I’m pretty sure that’s not 100% correct but it should tell what I’m trying to do.
This fixed the ID issue in Facebook debug tool, but I get the following value as an ID