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.