I am using Google Tag Manager for sending analytics to various channels like Google Analytics. Now I want to send analytics to Facebook as well but I could not find any way to do so.
PS: The question is for Android app not for website. I had found multiple ways to send events to Facebook for website like: https://www.advertisemint.com/install-facebook-pixel-google-tag-manager/
I have tried to do so for Android Container as well but it does not have CustomHtml option while creating Tag. I think their might be some different approach for this.
Go to your FB Pixel in the Events Manager, open your pixel and in the top right corner click Set Up > Install Pixel. Then choose Manually add pixel code to website and copy the main code: In Google Tag Manager, go to Tags > New > Custom HTML tag and paste the code.
Using Google Tag Manager (GTM) to help implement Facebook pixels will help you consistently and easily track conversion and events from your website, allowing you to prove the success (or failure) of your advertising while building valuable data inside of Facebook that can be used for future targeting.
If you want to use GTM in order to send events to FB analytics, you'll have to select "function call" when creating your tag in GTM. At this time, you'll have to populate the key-value pairs that you want to be in the payload your app will receive. You'll also have to reference a class which will handle this tag. This class will implement from com.google.android.gms.tagmanager.CustomTagProvider. Here is how a simple tag looks like in our GTM interface :
I helped to develop a connector called Cargo for my company, which helps to collect analytics through different platforms on mobile apps. Do not hesitate to take a look at it, or even to adopt it, and to pull some changes if you want to ! :)
I hope this helps !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With