Adsmurai-Google-Tag-Manager-Templates / adsmurai-facebook-pixel-and-conversions-api

Google Tag Manager template that fires Facebook, TikTok & Pinterest events through regular pixel and Conversions API.
Apache License 2.0
19 stars 8 forks source link

How to submit the FB click ID ? #18

Closed EW0JY closed 1 month ago

EW0JY commented 4 months ago

Hi guys,

I'm trying to submit the FB click ID both via the web client as well as the server client.

I've found that in the source code, there is the function "fbc: setOrGetFbcCookie()"

But in the tag settings, I can't actually find any field which says "_fbc" or "click ID" or anything.

What do I need to do that this parameter is sent to facebook via this tag as well as the CAPI?

Thank you :) !

mjadsmurai commented 3 months ago

Hi! Apologies for late reply (we had some festivities), You shouldn't need to do anything, it should be sent automatically on both cases. For the web part, we use the official FB SDK so they already look for the cookie themselves and for the server part we grab and send the value too (as long as you're using One Tag service and not the selfhosted version).

EW0JY commented 1 month ago

Thanks for your reply! While it sounds good that it should send the FBC ID automatically, according to my facebook data, it does not, unfortunately.

I have attached a screenshot for you.

Any idea as to why this isn't working as expected?

Thanks so much for your help!

Best wishes! Untitled

mjadsmurai commented 1 month ago

I've tried the full circuit and we do send the data (as long as it exists):

On the website, if the query param is detected it gets saved as cookie and sent to CAPI image (5)

On CAPI it is attached for FB events and sent to their api: Screenshot from 2024-06-17 08-51-22

So when can fbc not be sent? When the page doesn't receive it: Remember that said param only appears if the person comes from a FB ad. If they are direct visitors/SEO or from another platform, they won't have it. So you will never have all of your events with fbc.

Keep in mind that FB quality messages will also tell you things like "send IPv6 for better tracking" when it's completely out of your (and our) control to force visitors to have IPv6. Most of them have IPv4 as long as their internet providers don't upgrade their hardware. But still, fb will tell you like it's your fault and you could do better. The same happens here. They want all events to have all data, but it's simply not possible.

EW0JY commented 1 month ago

That's very helpful, thank you very much!

For some reason I had assumed that Facebook is only showing me the data for traffic that did come from Facebook Ads.

But it seems like what you're saying is that there could be the following situation at play here:

Let's assume 90% of my traffic are organic or from other platforms, and 10% from FB ads.

Then this data quality is telling me that the FBC ID is missing for 90% of the received events, correct?

That would explain it and would also mean that I don't need to worry about improving the data quality, since it's as good as it can be, right?

mjadsmurai commented 1 month ago

For some reason I had assumed that Facebook is only showing me the data for traffic that did come from Facebook Ads.

That's the thing, they have no way of doing this. Think of this case but for a person that is not using One Tag: They may do actually be missing fbc and that's why facebook cannot attribute that traffic to coming from Facebook Ads. This forces them to evaluate all received events to try to shine some light.

Let's assume 90% of my traffic are organic or from other platforms, and 10% from FB ads.

Then this data quality is telling me that the FBC ID is missing for 90% of the received events, correct?

Exactly.

I don't need to worry about improving the data quality,

It's good to check but now you know they recommendations won't always apply to you. What you should always be checking is our Health summary in OneTag because any error there is for real as we store facebook error responses. There you may find that "oh no, facebook expected a numeric amount and i am sending a string" or "i'm sending an invalid category"/details like that.

EW0JY commented 1 month ago

I really appreciate your helpfulness and detailed replies, let me point this out once again :) !

Everything you said makes total sense, thank you.

The only thing is that I had to look up what exactly OneTag is, since I currently have integrated the Adsmurai templates into GTM myself in combination with a tag server from another provider.

I suppose that in this case, there's no way to see the error responses you've mentioned, is there?

If not, I might have to consider giving OneTag a go at some point, although I dread the headache of reconfiguring everything again in GTM ;)....

mjadsmurai commented 1 month ago

Yep, on selfhosted there are no panels nor support for other channels.

On OneTag you will have a view like this: Screenshot from 2024-06-17 15-41-33

Which lets you easily see the health across all your pixels/channels. And you can also click on each event/error to see sample event/more details.

EW0JY commented 1 month ago

That looks helpful...I've actually subscribed to One Tag yesterday.

Currently still waiting for a reply from support to a few questions regarding the initial setup.

The thing is, that I already have the admurai GTM template due to the previous/current self-hosted integration.

So I'm unsure as to how the step-by-step setup would work, since I need to select which container I want One Tag to manage, but I already have a web container and a server client container, so I can't select two...

I'm not sure if you could give me some guidance on that?

In any case, is it possible to use One Tag only on certain pages (landing pages) which I send FB ad traffic to?

I don't want or need the generic page view event for any other pages.

mjadsmurai commented 1 month ago

I already have a web container and a server client container, so I can't select two...

with OneTag you only work on client container as it's where you place this tag :)

All you have to do is:

  1. On OneTag dashboard - Add all pixels you plan to use. Skip the onboarding page and go straight to Add pixel button:

Screenshot from 2024-06-18 16-16-04

  1. On OneTag dashboard - Generate a key.

Screenshot from 2024-06-18 16-17-01

  1. On GTM - Edit the tags to switch from selfhosted to OneTag by adding OneTag's key: Screenshot from 2024-06-18 16-18-17

Done! Make sure it works as usual before publishing. After a few hours you will also see the health panel on OneTag dashboard.

In any case, is it possible to use One Tag only on certain pages (landing pages) which I send FB ad traffic to?

I don't want or need the generic page view event for any other pages.

You can achieve this by setting a proper Trigger on the tag, GTM lets you set things like "only if the page contains XXX in it's path" as trigger :)

Screenshot from 2024-06-18 16-21-09

EW0JY commented 1 month ago

ah, that's super helpful, thank you so much!

Quick follow up:

  1. When you say "with OneTag you only work on client container", do you refer to what GTM calls "Web" or "Server" Container?

Untitled

  1. If I don't use the step-by-step setup but rather the way you suggested, does this mean I still need to go into GTM regularly to update the AdsMurai template? And if yes, would giving OneTag the permissions to manage a container for me (as part of the step-by-step setup) take care of the template updates in the future for me, or would I also still need to do that manually?
mjadsmurai commented 1 month ago

1.Web

  1. I still need to go into GTM regularly to update the AdsMurai template? : Yes. Updating the template it's something never done automatically, so you would also have to manually update it if you gave permissions.
EW0JY commented 1 month ago

Ok, understood, thanks so much for your outstanding help :) 👍 !