Do I need to load the Facebook/Meta Pixel when I use Tag Manager?

Our setup is the following:

  • Self-hosted Matomo instance with Tag Manager
  • Matomo set up to not track PII, loaded upon page load
  • Facebook Pixel is added to DOM when user accepts tracking

When the Pixel is not added to the DOM (f.e. because the visitor declines tracking), the console is free of warnings and errors. WIth the Pixel loaded, my Tag Manager’s button click trigger connected to a Facebook Pixel Tag causes a warning to show up in the console:

[Meta Pixel] - Duplicate Pixel ID: [My Pixel ID]

Is that normal behavior, or does should I leave loading the Pixel to the Tag Manager?

I just saw in the inspectors Network tab that Tag Manager loads Facebook’s tracking scripts the first time a Facebook Pixel trigger is used. I think that answers my question—there’s no need to embed the pixel when using Tag Manager.

Which now begs the question: How to let visitors opt in to third party tracking separately from Matomo?