Showing posts with label Google Analytics. Show all posts
Showing posts with label Google Analytics. Show all posts

Sunday, May 9, 2021

How to implement Firebase + GTM on a React Native App (step by step procedure for Android build)

There is good amount of documentation on how to implement GTM (Google Tag Manager) on a native android or an iOS app but nothing for a React Native app. There are couple of resources on the web which gives you the steps in implementing Firebase and GTM on a React Native app but there are some catches which no one mentions. First, the reason behind implementing both Firebase and GTM is Firebase acts as a data layer by sending different inbuilt events and the custom ones we implement. On GTM, we can intercept these Firebase events and play with them. So let's go ahead and see how to implement Firebase + GTM on a React Native App. This guide will contain details related to Android app but the process is similar for an iOS build as well.

Step 1 (Optional if you already have a react native app)


Install react native sample app by running the below line to get things started. If you have not installed NodeJS, you need to do that before you run the below command on command line. Also, you need an Android emulator or the corresponding one for iOS to run the app.

npx react-native init MyTestApp

Wednesday, April 15, 2020

How to track HTML 5 Videos using Google Tag Manager?

If you have a lot of videos embedded on your website which are not YouTube videos, it will be slightly difficult for you to track the video events using in built options of Google Tag Manager. However, we can use Custom HTML tag with few triggers and variables to achieve the tracking for any kind of HTML 5 video. If your video player uses HTML 5 format, then the below library can be used.

Here, we will be tracking "play", "pause", "complete", "milestones - 25, 50 and 75%" with the library and all of these are tracked as events in Google Analytics. Let us zero in the data we want to see in the reports. I want the event fired from the video to contain the below values

Tuesday, September 25, 2018

What is Channel Grouping and how to automate the rules for multiple Google Analytics views?

Recently I was working on a small requirement where I had to update all the 13 views under a Google Analytics property's Channel grouping rules. The catch here is the updated rules for all the 13 views look the same. I started updating the rules for one view and at the end of updating for one view, I am completely tired. So I was scared about the task that's in front of me. Then, I hacked into the Chrome Developer Tools and wrote some code and boom I was able to automate the processing of entering the rules and save it all in one click.