I use GTAG client side to send events to sGTM. If two events are sent almost at the same time or are being batched - e.g. page_view and view_item - and the visitor is new so there is no fbp cookie set, the result is a different fbp in the first and the second hit to the Conversion API.
I have enabled 'Generate _fbp cookie if it not exist' and 'Use HttpOnly cookies'. I guess this issue is a result of the fact that the first tag doesn't make it to set the cookie before the next event is triggered.
The 'Google Analytics: GA4' client seems to be able to handle this - probably because it is the client that sets the cookie instead of the tag.
A solution could be to generate the fbc value client-side and then send it along on every request. Then in the code check if there is a cookie value set - if not use the fbc value generated client-side and set that as the value of the _fbc cookie.
I use GTAG client side to send events to sGTM. If two events are sent almost at the same time or are being batched - e.g. page_view and view_item - and the visitor is new so there is no fbp cookie set, the result is a different fbp in the first and the second hit to the Conversion API. I have enabled 'Generate _fbp cookie if it not exist' and 'Use HttpOnly cookies'. I guess this issue is a result of the fact that the first tag doesn't make it to set the cookie before the next event is triggered. The 'Google Analytics: GA4' client seems to be able to handle this - probably because it is the client that sets the cookie instead of the tag. A solution could be to generate the fbc value client-side and then send it along on every request. Then in the code check if there is a cookie value set - if not use the fbc value generated client-side and set that as the value of the _fbc cookie.