Product Id missing when using Facebook Pixel

  • Essentially the title. I’ve uninstalled, reconnected both plugins. (Facebook for Woocommerce and RankMath) Made sure that all my products have SKUs, I’m not sure if that’s relevant.

    A required field is missing: id
    Products without "id" information can't be uploaded. Please check that this field is included for each product in a separate, labeled column.

    This in fact the same issue as this ticket, but it had no step by step solution. If someonw could explain further how to extend the the JSON-LD data

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math.

    Here is a code to give you you direction on how to apply this:

    
    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
        if ( isset( $data['Product'] ) ) {
            $data['product']['additionalProperty'] = ['@type' => 'PropertyValue', 
    		'propertyID'=> 'item_group_id', 
    		'value'=> 'fb_tshirts'];
        }
        return $data;
    }, 99, 2 );
    

    You only need to follow the markup guideline here: https://developers.facebook.com/docs/marketing-api/catalog/guides/microdata-tags#json-ld

    Looking forward to helping you. Thank you.

    ​​​​​​

Viewing 1 replies (of 1 total)

You must be logged in to reply to this ticket.