I want to use Facebook for WooCommerce to sync the product to Facebook, to make ads.
I make woocommerce as my backend only. Frontend I using React.
Therefore I have the structure like this:
- Backend: api.mysite.com (woocommerce)
- Frontend: mysite.com (Nextjs app)
So I call to Woocommerce Rest Api
to be used it in Frontend.
This working well so far. But right now I want to sync my product to Facebook using this woocommerce plugin.
Then I have this problem:
- Facebook for Woocommerce export the product feed with the url:
api.mysite.com/product/my-product
- When user click on my facebook ads, he/she will redirect to product page in
api.mysite.com
api.mysite.com
is only backend therefore without any design
What I want:
- I want Facebook for WooCommerce export my product feed with product URL:
mysite.com/product/my-product
- So user will redirect to product page
mysite.com
when click my ads mysite.com
will contain the frontend design
What I have tried:
Go to Setting > General -> Site Address (URL) -> Change this field to mysite.com
But this cause me another problem which is: Now I unable to call the Rest Api from frontend.
Over here have a question which almost same like mine: https://wordpress.org/support/topic/using-woocommerce-rest-api-with-gatsby/
But I dont know how to use facebook_for_woocommerce_integration_prepare_product
in order to suit my needs.
Someone please help in order to point me to right direction.