Unable to Add variable to all Facebook events that you have inside the Web Container

I tried following this guide: https://stape.io/how-to-set-up-facebook-event-deduplication-in-google-tag-manager/

I keep getting an error every time I try it to submit it in Google Tag Manager. Can anyone help me?

What type of error do you have? Would you please share screenshots of it?

I got it to work. Now I have an issue with the tracking from the server side. It only shows the view from server side tracking on my .com domain and not on my .dk domain. It is the same Facebook Pixel and Google Tag Manager. Do you know how to fix it?

Hello,

Please be a little bit more specific, it’s really hard to operate on “it shows”. What exactly are you seeing and where? A screenshot, or at least a more elaborate description would be appreciated and would give us a chance to actually help :slight_smile:

Sure :slight_smile:
When I try to test my events in Business Manager I am only able to see event ID from page views in the .com domain like in the screenshot here

And the server side tracking does not appear on every visit in my .dk domain - only the .com

And when I look at my test events none of the events are deduplicated. What have I done wrong?

I tried it again this morning and now when I test the events i Facebook my .com domain sends the following pageview-events


Is that correct? The event ID’s are not 100% identical. It is only the last figure that differs.

And I still have an issue with my server side tracking not showing up on my .dk domain.

so…

  1. Deduplication issue likely stems from you not handling event_id correctly. You can see that your browser event has an event_id value, while server one doesn’t. Screenshot from your second message has event id on both but it’s different - and it needs to be the same for deduplication purposes

  2. Hard to comment on 2 domains issue, you have .dk on initial screens and .com on latter ones. What is the problem exactly? From the looks of it you’re in test events tab - it will reflect domain that you actually testing on

Hi again

I tried some different things but now I get another error in Business Manager.

Can you tell from my setup in Tag Manager what I have done wrong?

Variables in GTM

Transport Tag

Facebook Pixel (browser)

GA4 Page view event

Variable in server container

Conversion API in server container

Thank you :slight_smile:

your (server)Facebook event_id equals to your (WEB)GA4 page_view event id and not your (WEB)FB tag, hence of course Pixel is receiving different information.

So this is the correct now?
FB base (browser)

Conversion API in server container

GA4 Page view event

Thank you :slight_smile:

no, you have the same issue still.

your server FB tag is triggered on GA4 client => server will pick up event id of the GA4 web event.

I am not quite sure how to fix it then.
What can I do to fix it? :slight_smile:

I’m not sure how to make this more accessible…Here are your basic ‘elements’:

  1. WEB FB Tag (sends event to FB)
  2. WEB GA4 Tag (sends event to your server container)
  3. SERVER FB Tag (sends event to FB)

In order for deduplication to work, you need to make it so that all 3 elements have SAME event_id.

Your ‘element 3’ is triggered of off ‘element 2’ and as such will pick it’s event_id, so that is covered.

Now, that narrows your task to making sure that ‘element 1’ and ‘element 2’ have same event ids, so:

  • use the same variable for those
  • have them both have SAME trigger
  • enjoy

Thank you for the answer. I think this is correct now. Is that right?

FB base (browser)

GA4 Page view event

Conversion API in server container

Well, if ‘Facebook event ID’ is a constant, as is shown on your initial screenshots, then no, it’s still wrong.
Your event_id server side should be Event Data variable with event_id key.

You should then launch server and web preview and see if it fires correctly, it’s very inefficient to check validity based on screenshots :slight_smile:

Good luck and happy tagging

I actually deleted the constanct “Facebook event ID” as I did not use it.
My event_id server side is now like this

Is that correct? :slight_smile:

I tried previewing in the server container but that did not work - it just showed a white screen. Do you know why?

  1. yes, your current Facebook event ID seems to be correct

  2. launching server preview does just that - launches server preview, if nothing was sent to the server - nothing would have been displayed. you need to launch server preview, launch web preview and then trigger those events you’ve setup