• Resolved Doron Nissim

    (@digidigiweb)


    When trying to create a product set in FB, I can’t group by product tag – only Category.
    Is there a way – maybe via one of the plugin’s hooks to make it so I will be able to group a product set by tags? Maybe send tag data via a custom label?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey @digidigiweb,

    Thanks so much for your question, there certainly is a plugin hook that would allow for this, though there are a few caveats.

    Firstly, you’re absolutely right, we don’t send the product tag data across to Facebook at this time, only the categories. When the plugin generates the data it Facebook it calls a filter that can be used to amend, or add, additional data:

    
    /**
    * Filters the generated product data.
    *
    * @param int   $id           Woocommerce product id
    * @param array $product_data An array of product data
    */
    return apply_filters(
    	'facebook_for_woocommerce_integration_prepare_product',
    	$product_data,
    	$id
    );
    

    This would allow you to retrieve the product, grab the tags, and use the Facebook developer documentation for a Product Item to maybe assign the values to custom_label_0.

    The caveat is that this would only apply when syncing the product directly, which is no longer possible in the current version, but will be reintroduced in the next major release.

    The reason for this is that the current sync mechanism uses a feed file instead, which Facebook retrieves once per hour from your site. This feed file has hardcoded columns, and so it’s currently not possible to use the above filter and have the information added to the feed file.

    The only workaround in the short term would be to manually edit either the plugin code (to also write the column data for your new custom label) or insert the columns into the generated CSV file manually, and wait for Facebook to sync. The problem with this last option is that the file is regenerated every 15 minutes, so you may want to manually upload the manually edited CSV instead if you went down this path.

    I’m sorry for the long-winded answer, though I hope that gives you some options for what you’re looking to achieve!

    Do any of these seem like a winning combination for the short term?

    Cheers!

    Simon.

    Hello, Is this working now? I really need to sync product tags.

    Hey @basselenab,

    Thanks so much for reaching out to us! At this time, the plugin doesn’t sync product tags but I would recommend taking a look at the recommendations my colleague Simon noted above. Would any of those recommendations work for your site?

    I’d love to learn a little more about how you’d use this functionality so I can share this feature request with my product team. Would you please share some additional details on how this is helpful for your business?

    Thanks,
    Tamara

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Creating product sets in FB by product tag’ is closed to new replies.