{"id":96560,"date":"2025-02-19T02:08:39","date_gmt":"2025-02-19T02:08:39","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/android-quickstart-with-google-analytics-for-firebase-and-google-tag-manager\/"},"modified":"2025-02-19T02:08:39","modified_gmt":"2025-02-19T02:08:39","slug":"android-quickstart-with-google-analytics-for-firebase-and-google-tag-manager","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=96560","title":{"rendered":"Android Quickstart With Google Analytics For Firebase And Google Tag Manager"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<p>With the release of <a href=\"https:\/\/www.blog.google\/products\/marketingplatform\/analytics\/new-way-unify-app-and-website-measurement-google-analytics\/\">Google Analytics: App + Web<\/a>, <a href=\"https:\/\/firebase.google.com\/\">Firebase<\/a> is suddenly all the rage. The new <strong>App + Web property<\/strong> can combine data from your website and mobile apps, as long as the latter uses <a href=\"https:\/\/firebase.google.com\/docs\/analytics\">Google Analytics for Firebase<\/a>, formerly known as Firebase Analytics.<\/p>\n<p>In this guide, I\u2019ll walk you through the steps of creating an <em>extremely<\/em> simple Android application, and we\u2019ll then create a Firebase project, and for good measure add <a href=\"https:\/\/developers.google.com\/tag-manager\/android\/v5\/\">Google Tag Manager<\/a> to the mix.<\/p>\n<blockquote>\n<p><strong>UPDATE 21 August 2019:<\/strong> I have now published a similar guide <a href=\"https:\/\/www.simoahava.com\/analytics\/ios-quickstart-google-analytics-firebase-tag-manager\/\">for iOS<\/a>, too. Enjoy!<\/p>\n<\/blockquote>\n<div style=\"aspect-ratio: 3032 \/ 1692;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/android-quickstart-firebase.jpg\" title=\"Android Quickstart for Firebase\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1692\" width=\"3032\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/android-quickstart-firebase.jpg#ZgotmplZ\" alt=\"Android Quickstart for Firebase\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>To follow along, all you need is a computer. You don\u2019t need an Android device, even if debugging is nicer with an actual phone rather than an emulator.<\/p>\n<p>I\u2019ve also recorded <a href=\"https:\/\/www.youtube.com\/watch?v=brPF0qRvcLU\">a video<\/a> if you prefer to <em>see<\/em> the guide rather than <em>read<\/em> it.<\/p>\n<p>\n  <iframe src=\"https:\/\/www.youtube-nocookie.com\/embed\/brPF0qRvcLU?enablejsapi=1\" style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;\" allowfullscreen=\"\" title=\"YouTube Video\"><\/iframe>\n<\/p>\n<p>                <span class=\"simmer\"><br \/>\n  <span class=\"close\">X<\/span><\/p>\n<p>\n    <span class=\"fa fa-md fa-bell\"\/><br \/>\n    <strong>The Simmer Newsletter<\/strong>\n  <\/p>\n<p>\n    Subscribe to the <a href=\"https:\/\/www.simoahava.com\/newsletter\/\">Simmer newsletter<\/a> to get the latest news and content from Simo Ahava into your email inbox!\n  <\/p>\n<p>  <\/span><\/p>\n<h2 id=\"what-youll-build\">What you\u2019ll build<\/h2>\n<p>We\u2019ll create <strong>an Android application<\/strong> using Android Studio. This application can be run on your Android device or in an Android emulator (a <em>virtual device<\/em>).<\/p>\n<p>We\u2019ll create a <strong>Firebase project<\/strong> and deploy Firebase into the application. We\u2019ll fire a basic event so we\u2019ll know how to debug the hits sent from Firebase to Google Analytics.<\/p>\n<p>We\u2019ll create a <strong>Google Tag Manager<\/strong> container for Firebase, and we\u2019ll install that in the application. We\u2019ll use that container to take the event we configured for Firebase and send the data to a (non-Firebase) Google Analytics property as well.<\/p>\n<p>The purpose of this guide is to show you how each of the components listed above works. It will do so in a very superficial manner, but you should be able to see how easy it is to create a mobile application and add some basic analytics to it.<\/p>\n<h2 id=\"step-1-create-a-project-in-android-studio\">Step 1: Create a project in Android Studio<\/h2>\n<p>First of all, visit <a href=\"https:\/\/developer.android.com\/studio\">this link<\/a> to download Android Studio. Android Studio is an IDE (integrated development environment) for building on top of the Android operating system.<\/p>\n<div style=\"aspect-ratio: 1988 \/ 628;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/download-android-studio.jpg\" title=\"Download Android Studio\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"628\" width=\"1988\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/download-android-studio.jpg#ZgotmplZ\" alt=\"Download Android Studio\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>We\u2019ll be using Android Studio to develop and debug our application. So, to get things started, fire up Android Studio, and choose <strong>Start a new Android Studio project<\/strong> from the splash screen.<\/p>\n<div style=\"aspect-ratio: 1334 \/ 962;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/start-new-as-project.jpg\" title=\"Start new Android Studio project\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"962\" width=\"1334\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/start-new-as-project.jpg#ZgotmplZ\" alt=\"Start new Android Studio project\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Choose <strong>Empty Activity<\/strong> as the template and click <strong>Next<\/strong>.<\/p>\n<div style=\"aspect-ratio: 1772 \/ 746;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/empty-activity.jpg\" title=\"Empty activity\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"746\" width=\"1772\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/empty-activity.jpg#ZgotmplZ\" alt=\"Empty activity\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Give the project a <strong>Name<\/strong> &#8211; can be anything you like. Take note of the <strong>Package name<\/strong> generated for the project (you can edit this if you want), as we\u2019ll need it when configuring Firebase. Make sure the <strong>Save location<\/strong> target exists &#8211; Android Studio will automatically create the directory for the project, but the location where the project directory is created must be a valid one.<\/p>\n<p>Check the box next to <em><em>Use androidx.<\/em> artifacts<\/em>*, as we\u2019ll need them for the latest releases of Firebase.<\/p>\n<p>Click <strong>Finish<\/strong> when ready.<\/p>\n<div style=\"aspect-ratio: 1420 \/ 920;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/project-configuration.jpg\" title=\"Project Configuration\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"920\" width=\"1420\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/project-configuration.jpg#ZgotmplZ\" alt=\"Project Configuration\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Android Studio will <strong>build<\/strong> your application and load the basic dependencies while at it. Once the bottom bar says something like <strong>Gradle build finished in NNN ms<\/strong>, you can click the <strong>Play<\/strong> button in the header bar to run your application.<\/p>\n<div style=\"aspect-ratio: 1712 \/ 236;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/run-application.jpg\" title=\"Run application\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"236\" width=\"1712\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/run-application.jpg#ZgotmplZ\" alt=\"Run application\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>At this point, if you have an <strong>Android phone<\/strong> plugged into the USB port of your computer, you should see the phone in the list of connected devices. If the phone is running an Android OS version higher than the minimum set for the project (<strong>19<\/strong> by default), you should be able to run the application on the phone by choosing it and clicking <strong>OK<\/strong>.<\/p>\n<p>Otherwise, you\u2019ll need to create a <strong>Virtual device<\/strong>, so click <strong>Create New Virtual Device<\/strong> to launch the Android Virtual Device (AVD) Manager.<\/p>\n<div style=\"aspect-ratio: 1250 \/ 952;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/create-virtual-device.jpg\" title=\"Create virtual device\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"952\" width=\"1250\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/create-virtual-device.jpg#ZgotmplZ\" alt=\"Create virtual device\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>In the next screen, choose a phone model such as the <strong>Nexus 5<\/strong> and click <strong>Next<\/strong>.<\/p>\n<div style=\"aspect-ratio: 1686 \/ 552;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/nexus-5.jpg\" title=\"Nexus 5\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"552\" width=\"1686\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/nexus-5.jpg#ZgotmplZ\" alt=\"Nexus 5\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>You need to choose a <strong>System image<\/strong> to format the device with. Download one of the recommended releases (I\u2019m using <strong>Pie<\/strong>), as they should all have an API level higher than the one configured for the application. When the download is complete, finalize the configuration by clicking <strong>Next<\/strong>.<\/p>\n<div style=\"aspect-ratio: 1974 \/ 896;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/system-image.jpg\" title=\"System image\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"896\" width=\"1974\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/system-image.jpg#ZgotmplZ\" alt=\"System image\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>If you want, you can change the device name here, but you can leave all the other settings with their default values. Click <strong>Finish<\/strong> to create the device.<\/p>\n<p>Now you should see the device in the <strong>Available Virtual Devices<\/strong> of the deployment target selection. Make sure the device is selected and click <strong>OK<\/strong> to fire it up and run the application.<\/p>\n<div style=\"aspect-ratio: 1232 \/ 718;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/run-device.jpg\" title=\"Run device\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"718\" width=\"1232\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/run-device.jpg#ZgotmplZ\" alt=\"Run device\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>It\u2019s going to take a while to boot up the virtual device, install the application (APK) in it, and then fire it up. But once it\u2019s done, you should see this:<\/p>\n<div style=\"aspect-ratio: 1924 \/ 1282;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/app-in-device.jpg\" title=\"Application running\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1282\" width=\"1924\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/app-in-device.jpg#ZgotmplZ\" alt=\"Application running\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Congratulations, you\u2019ve built an Android application! The virtual device functions just like a real device, and you can use the device controls to move around the settings and applications menus just as you would with a real device.<\/p>\n<p>Next, we\u2019ll need to add <strong>Firebase<\/strong> to the application.<\/p>\n<h2 id=\"step-2-create-a-firebase-project\">Step 2: Create a Firebase project<\/h2>\n<p>To be able to leverage <strong>Google Analytics for Firebase<\/strong> and to implement Google Tag Manager in the application, we need to create a Firebase project and configure its SDK in our application. Fortunately, this is very easy to do.<\/p>\n<p>Browse to <a href=\"https:\/\/console.firebase.google.com\/\">https:\/\/console.firebase.google.com\/<\/a>, login to Google services if necessary, and click to <strong>Create a project<\/strong>.<\/p>\n<div style=\"aspect-ratio: 1180 \/ 596;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/create-firebase-project.jpg\" title=\"Create Firebase project\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"596\" width=\"1180\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/create-firebase-project.jpg#ZgotmplZ\" alt=\"Create Firebase project\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Give the project a name. Make note of the project ID given to the project (you can edit this if you wish, but it must be unique). It\u2019s the name of the project that will be created in the Google Cloud Platform automatically for you.<\/p>\n<div style=\"aspect-ratio: 1490 \/ 1156;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/name-firebase-project.jpg\" title=\"Name firebase project\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1156\" width=\"1490\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/name-firebase-project.jpg#ZgotmplZ\" alt=\"Name firebase project\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>In the next screen, make sure <strong>Set up Google Analytics for my project<\/strong> is selected and click <strong>Continue<\/strong>.<\/p>\n<p>Now you can select a Google Analytics account you have access to, or you can create a new account. The latter option is mandatory if you don\u2019t have access to any Google Analytics accounts.<\/p>\n<p>If you need to create a new account, configure its data sharing settings first.<\/p>\n<p>Then, click <strong>Create project<\/strong> to link the Firebase project to the Google Analytics account you selected (or created). Note, this will create a new [<strong>App + Web property<\/strong>]({}) with an App Stream in the target Google Analytics account.<\/p>\n<div style=\"aspect-ratio: 2144 \/ 1890;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/create-analytics-project.jpg\" title=\"Create analytics project\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1890\" width=\"2144\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/create-analytics-project.jpg#ZgotmplZ\" alt=\"Create analytics project\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>You\u2019ll see a spinner while the service creates your project. Wait patiently.<\/p>\n<div style=\"aspect-ratio: 798 \/ 562;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/creating-project-spinner.jpg\" title=\"Creating project spinner\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"562\" width=\"798\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/creating-project-spinner.jpg#ZgotmplZ\" alt=\"Creating project spinner\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Once done, it will tell you that your new project is ready, so click <strong>Continue<\/strong> to configure the SDK.<\/p>\n<h2 id=\"step-3-deploy-firebase-project-in-application\">Step 3: Deploy Firebase project in application<\/h2>\n<p>In the dashboard, click the little Android mascot head to configure the Firebase project to work in your application.<\/p>\n<div style=\"aspect-ratio: 1394 \/ 634;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/add-firebase-to-android.jpg\" title=\"Add Firebase to Android\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"634\" width=\"1394\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/add-firebase-to-android.jpg#ZgotmplZ\" alt=\"Add Firebase to Android\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>The first thing you need to do is <strong>Register the app<\/strong>, so type the package name configured for your application in the respective field.<\/p>\n<p>If you can\u2019t remember the package name, you can open the <code>AndroidManifest.xml<\/code> in the <code>\/app\/manifests\/<\/code> directory, and check the value of the <code>package<\/code> attribute in the <code><manifest\/><\/code> tag.<\/p>\n<div style=\"aspect-ratio: 1982 \/ 346;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/package-name.jpg\" title=\"Package name\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"346\" width=\"1982\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/package-name.jpg#ZgotmplZ\" alt=\"Package name\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Once you\u2019ve filled the fields, click <strong>Register app<\/strong>.<\/p>\n<div style=\"aspect-ratio: 1336 \/ 1034;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/my-test-application-register.jpg\" title=\"My test application - register\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1034\" width=\"1336\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/my-test-application-register.jpg#ZgotmplZ\" alt=\"My test application - register\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>In the next screen, you are prompted to download the <code>google-service.json<\/code> file. Click the button to do so, and then switch to Android Studio.<\/p>\n<div style=\"aspect-ratio: 1396 \/ 672;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/google-services-download.jpg\" title=\"Google Services download\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"672\" width=\"1396\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/google-services-download.jpg#ZgotmplZ\" alt=\"Google Services download\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>In Android Studio, first click the \u201cAndroid\u201d label to open the drop-down menu for the project navigator view, and choose <strong>Project<\/strong> to see the full directory structure of the project.<\/p>\n<div style=\"aspect-ratio: 1036 \/ 290;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/project-view.jpg\" title=\"Project View\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"290\" width=\"1036\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/project-view.jpg#ZgotmplZ\" alt=\"Project View\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Next, expand the project directory and the <code>\/app\/<\/code> folder within, and drag-and-drop the <code>google-services.json<\/code> from your downloads into the <code>\/app\/<\/code> directory. Click OK if you see a dialog asking if it\u2019s ok to move the file. It should end up looking like this:<\/p>\n<div style=\"aspect-ratio: 954 \/ 550;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/services-in-app.jpg\" title=\"Google Services in app folder\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"550\" width=\"954\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/services-in-app.jpg#ZgotmplZ\" alt=\"Google Services in app folder\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Once you\u2019ve done this, go back to the web browser and click <strong>Next<\/strong> to proceed to the next step in your Firebase project creation.<\/p>\n<p>In this step, you are asked to add the Firebase dependencies to your project- and app-level <a href=\"https:\/\/gradle.org\/\"><strong>Gradle<\/strong><\/a> files. Gradle is the build tool used by Android Studio applications, and it governs, among other things, the dependencies that the app needs to load in order to compile and run. Firebase is one such dependency.<\/p>\n<p>The first file you need to edit is the <strong>project-level<\/strong> <code>build.gradle<\/code> file. You can find this in the root of your project folder, so double-click it in Android studio to open it for editing.<\/p>\n<div style=\"aspect-ratio: 2390 \/ 966;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/project-gradle.jpg\" title=\"Project-level gradle\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"966\" width=\"2390\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/project-gradle.jpg#ZgotmplZ\" alt=\"Project-level gradle\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Find the <code>dependencies<\/code> block, and add this line to the end:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-text\" data-lang=\"text\">dependencies {\n  ...\n  classpath 'com.google.gms:google-services:4.3.0'\n}<\/code><\/pre>\n<\/div>\n<blockquote>\n<p>Note! At the time of writing, the Firebase console recommends <code>google-services:4.2.0<\/code>, but you can upgrade this to <code>4.3.0<\/code> as in the code example above. If a newer version is available, this will be indicated by a yellow highlight around the <code>classpath<\/code> code.<\/p>\n<\/blockquote>\n<p>Save the file, and then open the <code>\/app\/build.gradle<\/code> file.<\/p>\n<div style=\"aspect-ratio: 1876 \/ 728;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/app-build-gradle.jpg\" title=\"App build.gradle\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"728\" width=\"1876\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/app-build-gradle.jpg#ZgotmplZ\" alt=\"App build.gradle\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Here, edit the <code>dependencies<\/code> block again to add two new lines to the end:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-text\" data-lang=\"text\">dependencies {\n  ...\n  implementation 'com.google.firebase:firebase-core:17.0.1'\n  implementation 'com.google.android.gms:play-services-tagmanager:17.0.0'\n}<\/code><\/pre>\n<\/div>\n<blockquote>\n<p>Note! Again, if there are newer versions of the Firebase core and Google Tag Manager dependencies available, this will be indicated with a yellow highlight around the <code>implementation<\/code> statements.<\/p>\n<\/blockquote>\n<p>As you can see, we are already adding GTM as a dependency. It won\u2019t do anything until we <a href=\"#step-6-download-google-tag-manager-container\">configure the container<\/a>, though.<\/p>\n<p>Finally, add the following line to the end of the <code>build.gradle<\/code> file:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-text\" data-lang=\"text\">apply plugin: 'com.google.gms.google-services'<\/code><\/pre>\n<\/div>\n<div style=\"aspect-ratio: 1128 \/ 484;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/app-gradle-ready.jpg\" title=\"app.gradle ready\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"484\" width=\"1128\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/app-gradle-ready.jpg#ZgotmplZ\" alt=\"app.gradle ready\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Save the file. Now you can click the <strong>Sync now<\/strong> button in the blue header on top of the code editor to have the application download and build the dependencies you just added.<\/p>\n<div style=\"aspect-ratio: 2980 \/ 350;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/sync-now-gradle.jpg\" title=\"Sync now gradle\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"350\" width=\"2980\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/sync-now-gradle.jpg#ZgotmplZ\" alt=\"Sync now gradle\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>You might see a <strong>warning<\/strong> about deprecated methods or features in the sync log, but the sync should still complete successfully.<\/p>\n<div style=\"aspect-ratio: 1740 \/ 520;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/sync-successful.jpg\" title=\"Sync successful\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"520\" width=\"1740\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/sync-successful.jpg#ZgotmplZ\" alt=\"Sync successful\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Now, in the web browser where you are creating the Firebase application, you need to click <strong>Next<\/strong> to enter the final stage. Here, Firebase waits for your application to send a request to Firebase servers. To do so, make sure you are connected to the internet, and <strong>run your app<\/strong> (by clicking the Play button in the Android Studio interface). If all goes well, the application will run, send a request to Firebase servers, and you\u2019ll see the project creation view change to this:<\/p>\n<div style=\"aspect-ratio: 1458 \/ 484;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/run-app-to-verify.jpg\" title=\"run app to verify\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"484\" width=\"1458\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/run-app-to-verify.jpg#ZgotmplZ\" alt=\"run app to verify\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Click <strong>Continue to console<\/strong> to go back to the Firebase dashboard.<\/p>\n<p>Congratulations! Firebase is now running in your app. You can scroll through the different screens in the Firebase console, but you won\u2019t find anything useful, yet. You still need to make Firebase <em>do something<\/em>. And that something, in this guide, will be to collect data.<\/p>\n<h2 id=\"step-4-implement-basic-analytics\">Step 4: Implement basic analytics<\/h2>\n<p>To implement some analytics logging, we need to load the Firebase Analytics dependency, and then initialize it in our application.<\/p>\n<p>So, open the <code>build.gradle<\/code> file under <code>\/app\/<\/code> again, and add the following new dependency:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-text\" data-lang=\"text\">dependency {\n  ...\n  implementation 'com.google.firebase:firebase-analytics:17.0.1'\n}<\/code><\/pre>\n<\/div>\n<p>Click the <strong>Sync now<\/strong> button in the editor to synchronize your application with this latest change to its dependencies.<\/p>\n<p>Then, open the <code>MainActivity.kt<\/code> file for editing. You can find it in <code>\/app\/src\/main\/java\/_project_\/<\/code>. You can also hit <strong>CMD + Shift + O<\/strong> and type <code>MainActivity.kt<\/code> in the selector to find and open the file. In any case, you should end up with the file open in the editor.<\/p>\n<div style=\"aspect-ratio: 1848 \/ 588;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/mainactivity.jpg\" title=\"Main Activity\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"588\" width=\"1848\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/mainactivity.jpg#ZgotmplZ\" alt=\"Main Activity\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p><strong>Activities<\/strong> correspond to views and screens in the application. They are so much more than that (<a href=\"https:\/\/developer.android.com\/guide\/components\/activities\/intro-activities\">read here<\/a>), but as an analogy this will suffice for now. The <code>MainActivity.kt<\/code> file contains code that is run when the application is opened. This is because the application comprises just one activity.<\/p>\n<p>If the application had different screens or views, we would create additional activities for them.<\/p>\n<p>In the <code>MainActivity.kt<\/code> file, add the following code right after the <code>class MainActivity<\/code> heading.<\/p>\n<p>Before hitting enter after typing <code>FirebaseAnalytics<\/code>, you\u2019ll see a little tooltip appear that identifies the class you are trying to create an instance of. Hit enter to <em>automatically<\/em> add the <code>import<\/code> command for the <code>FirebaseAnalytics<\/code> class.<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-kotlin\" data-lang=\"kotlin\"><span style=\"color:#00a\">class<\/span> <span style=\"color:#0a0;text-decoration:underline\">MainActivity<\/span> : AppCompatActivity() {\n  \n  <span style=\"color:#aaa;font-style:italic\">\/\/ ADD THIS:\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#00a\">private<\/span> <span style=\"color:#00a\">lateinit<\/span> <span style=\"color:#00a\">var<\/span> firebaseAnalytics: FirebaseAnalytics\n  \n  <span style=\"color:#aaa;font-style:italic\">\/\/ DON'T TOUCH\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#00a\">override<\/span> <span style=\"color:#00a\">fun<\/span> <span style=\"color:#0a0\">onCreate<\/span>(savedInstanceState: Bundle?) {\n    ...\n  }\n}<\/code><\/pre>\n<\/div>\n<p>If you can\u2019t get the tooltip to appear, or if the automatic import doesn\u2019t work, you can expand the <code>import<\/code> statements in the top of the <code>MainActivity.kt<\/code> file, and manually add the <code>FirebaseAnalytics<\/code> module.<\/p>\n<div style=\"aspect-ratio: 1324 \/ 562;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/lateinit-call.jpg\" title=\"Lateinit call\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"562\" width=\"1324\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/lateinit-call.jpg#ZgotmplZ\" alt=\"Lateinit call\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>With this code, we are initializing a variable named <code>firebaseAnalytics<\/code> of the type <code>FirebaseAnalytics<\/code>. We are using the <code>lateinit<\/code> keyword to avoid having to initialize it with a value (as we\u2019ll only have the value once the activity has loaded).<\/p>\n<p>Next, in the <code>onCreate<\/code> method we can actually initialize the variable. Add this line to the end of the <code>onCreate<\/code> method block:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-kotlin\" data-lang=\"kotlin\">firebaseAnalytics = FirebaseAnalytics.getInstance(<span style=\"color:#00a\">this<\/span>)<\/code><\/pre>\n<\/div>\n<p>This initializes the <code>firebaseAnalytics<\/code> local variable as an instance of the <code>FirebaseAnalytics<\/code> class. We can now use the <code>firebaseAnalytics<\/code> variable within this <code>MainActivity<\/code> class to send data to Firebase Analytics.<\/p>\n<div style=\"aspect-ratio: 1116 \/ 330;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/init-firebaseanalytics.jpg\" title=\"Initialize Firebase Analytics\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"330\" width=\"1116\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/init-firebaseanalytics.jpg#ZgotmplZ\" alt=\"Initialize Firebase Analytics\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>To send an event to Firebase Analytics, you need to call the <code>logEvent()<\/code> method of the <code>firebaseAnalytics<\/code> instance. The call takes two parameters: an <strong>event name<\/strong>, and a <strong>bundle<\/strong> of parameters (key-value pairs).<\/p>\n<p>To keep things simple, we\u2019ll send the event to Firebase from the same <code>onCreate<\/code> method, which means it will be sent as soon as the application has loaded (and Firebase with it).<\/p>\n<p>Let\u2019s add a simple key-value pair using the recommended parameter <strong>Item ID<\/strong>. These prescribed parameters can be found as properties of the <code>FirebaseAnalytics.Param<\/code> enum.<\/p>\n<p>Edit the <code>onCreate<\/code> method to look like this:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-kotlin\" data-lang=\"kotlin\"><span style=\"color:#00a\">override<\/span> <span style=\"color:#00a\">fun<\/span> <span style=\"color:#0a0\">onCreate<\/span>(savedInstanceState: Bundle?) {\n  ...\n  \n  firebaseAnalytics = FirebaseAnalytics.getInstance(<span style=\"color:#00a\">this<\/span>)\n  \n  <span style=\"color:#00a\">val<\/span> bundle = Bundle()\n  bundle.putString(FirebaseAnalytics.Param.ITEM_ID, <span style=\"color:#a50\">\"my_item_id\"<\/span>)\n}<\/code><\/pre>\n<\/div>\n<p>We create a new <code>Bundle<\/code> instance, to which we add a single parameter with the name <code>item_id<\/code> (stored in the enum <code>FirebaseAnalytics.Param.ITEM_ID<\/code>) and value <code>\"my_item_id\"<\/code>.<\/p>\n<div style=\"aspect-ratio: 1124 \/ 348;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/analytics-bundle.jpg\" title=\"Analytics bundle()\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"348\" width=\"1124\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/analytics-bundle.jpg#ZgotmplZ\" alt=\"Analytics bundle()\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Next, we need to send the bundle to Firebase Analytics together with an <strong>event name<\/strong>. Prescribed event names can be found within <code>FirebaseAnalytics.Event<\/code>. We\u2019ll use the <code>SELECT_CONTENT<\/code> event name for this exercise.<\/p>\n<p>Add the following line to the end of the <code>onCreate<\/code> method:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-kotlin\" data-lang=\"kotlin\"><span style=\"color:#00a\">override<\/span> <span style=\"color:#00a\">fun<\/span> <span style=\"color:#0a0\">onCreate<\/span>(savedInstanceState: Bundle?) {\n  ...\n  \n  firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle)\n}<\/code><\/pre>\n<\/div>\n<div style=\"aspect-ratio: 1312 \/ 404;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/select-content-event.jpg\" title=\"select content event\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"404\" width=\"1312\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/select-content-event.jpg#ZgotmplZ\" alt=\"select content event\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Once you\u2019ve made the changes, you can run the application to have it log events to Firebase. Once the app is running, you can enter the <strong>StreamView<\/strong> report in your Firebase Analytics console, and you should see the console collecting data from your application.<\/p>\n<p>Note that Firebase processes dispatched events in <code>batches<\/code>, and it\u2019s possible your <code>select_content<\/code> event doesn\u2019t make it to the first batch. So at this point just make sure that StreamView is showing <strong>some data<\/strong> so that you can verify your Firebase Analytics setup works. Firebase <a href=\"https:\/\/support.google.com\/firebase\/answer\/6317485?hl=en\">collects certain events by default<\/a> (e.g. <code>user_engagement<\/code>, <code>first_open<\/code>, <code>screen_view<\/code>), so you should see these in the StreamView.<\/p>\n<p>Luckily we have the <strong>DebugView<\/strong> for getting more Real Time data from our debugging devices. Read on!<\/p>\n<h2 id=\"step-5-debug\">Step 5: Debug<\/h2>\n<p>To have data appear in <strong>DebugView<\/strong>, you need to first register your virtual device as a valid <strong>Debug Device<\/strong>. To do that, click to open the <strong>Terminal<\/strong> tab in Android Studio <strong>with the virtual device running<\/strong>.<\/p>\n<div style=\"aspect-ratio: 1014 \/ 788;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/open-terminal.jpg\" title=\"Open the terminal\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"788\" width=\"1014\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/open-terminal.jpg#ZgotmplZ\" alt=\"Open the terminal\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>In the terminal console, type this and press Enter. Substitute <code>com.example.mytestapplication<\/code> with your application\u2019s <strong>package name<\/strong>.<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-text\" data-lang=\"text\">adb shell setprop debug.firebase.analytics.app com.example.mytestapplication<\/code><\/pre>\n<\/div>\n<p>You might see a warning about mismatched server-client versions, but if you see the text <code>* daemon started successfully<\/code>, you\u2019ll know it worked.<\/p>\n<div style=\"aspect-ratio: 1594 \/ 268;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/start-debug.jpg\" title=\"Start debug\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"268\" width=\"1594\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/start-debug.jpg#ZgotmplZ\" alt=\"Start debug\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Now, run the application again and open the <strong>DebugView<\/strong> report in Firebase. Your device should appear in the <strong>Debug Device<\/strong> list (it might take a moment to appear), and your debug events should start appearing in the stream. You can click the <code>select_content<\/code> event to see the custom parameter being sent.<\/p>\n<div style=\"aspect-ratio: 2728 \/ 1134;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/debugview-works.jpg\" title=\"DebugView works!\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1134\" width=\"2728\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/debugview-works.jpg#ZgotmplZ\" alt=\"DebugView works!\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Nice! You\u2019re collecting analytics data from your application to Firebase.<\/p>\n<p>The last thing we\u2019ll do is use that <code>select_content<\/code> hit to send a request to Universal Analytics, and we\u2019ll use Google Tag Manager to do so.<\/p>\n<h2 id=\"step-6-download-google-tag-manager-container\">Step 6: Download Google Tag Manager container<\/h2>\n<p>First, <strong>if you want to see the data in an actual Google Analytics report<\/strong>, you\u2019ll need to create a <strong>Mobile View<\/strong> in Google Analytics. It\u2019s not very intuitive, but you need to create a new <strong>Web Property<\/strong>, and then a new <strong>Mobile App View<\/strong> under that Property.<\/p>\n<p><strong>NOTE!<\/strong> This is not necessary to test the integration. We can inspect the requests sent by the application to verify they are being sent to Google Analytics, even if the target property hasn\u2019t been configured to accept mobile app data.<\/p>\n<div style=\"aspect-ratio: 1722 \/ 1190;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/mobile-app-view.jpg\" title=\"Mobile app view\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1190\" width=\"1722\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/mobile-app-view.jpg#ZgotmplZ\" alt=\"Mobile app view\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Go to <a href=\"https:\/\/tagmanager.google.com\/\">https:\/\/tagmanager.google.com\/<\/a> and create a new <strong>Container<\/strong> under an account of your choosing (if necessary, create the GTM account first).<\/p>\n<p>Choose <strong>Android<\/strong> as the container type, give the container a name, and then click to <strong>Create<\/strong> it.<\/p>\n<div style=\"aspect-ratio: 1714 \/ 1268;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/create-android-container.jpg\" title=\"Create Android Container\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1268\" width=\"1714\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/create-android-container.jpg#ZgotmplZ\" alt=\"Create Android Container\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Next, create a new <strong>Tag<\/strong> and choose <strong>Google Analytics: Universal Analytics<\/strong> as the type. Select <strong>Event<\/strong> as the Track Type, and add something like <code>Test Event<\/code> as the Event Category.<\/p>\n<p>In <strong>Event Action<\/strong>, type <code>{{<\/code> in the field and click <strong>New Variable\u2026<\/strong> from the drop-down menu.<\/p>\n<div style=\"aspect-ratio: 1382 \/ 1118;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/create-new-variable.jpg\" title=\"Create new variable\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1118\" width=\"1382\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/create-new-variable.jpg#ZgotmplZ\" alt=\"Create new variable\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Choose <strong>Event Parameter<\/strong> as the variable type.<\/p>\n<div style=\"aspect-ratio: 3264 \/ 814;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/event-variable-type.jpg\" title=\"Event variable type\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"814\" width=\"3264\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/event-variable-type.jpg#ZgotmplZ\" alt=\"Event variable type\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>From the <strong>Event Parameter<\/strong> drop-down, find <code>item_id<\/code>. Name the variable e.g. <code>Firebase - item_id<\/code>, and click to <strong>Save<\/strong> it.<\/p>\n<div style=\"aspect-ratio: 2774 \/ 1272;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/configure-item-id.jpg\" title=\"Item-id\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1272\" width=\"2774\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/configure-item-id.jpg#ZgotmplZ\" alt=\"Item-id\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Back in the tag, check <strong>Enable overriding settings in this tag<\/strong>, and type the <code>UA-XXXXXX-Y<\/code> number for your GA property in the <strong>Tracking ID<\/strong> field. If you only care about testing, you can type a dummy ID like <code>UA-12345-1<\/code> here.<\/p>\n<div style=\"aspect-ratio: 1048 \/ 568;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/tracking-id.jpg\" title=\"Tracking ID\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"568\" width=\"1048\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/tracking-id.jpg#ZgotmplZ\" alt=\"Tracking ID\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Now, click the <strong>Triggering<\/strong> box to add a new trigger to the tag. In the flyout, click the blue plus icon to create a new trigger.<\/p>\n<div style=\"aspect-ratio: 1900 \/ 338;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/create-new-trigger.jpg\" title=\"Create new trigger\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"338\" width=\"1900\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/create-new-trigger.jpg#ZgotmplZ\" alt=\"Create new trigger\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Choose <strong>Custom<\/strong> as the trigger type, check <strong>Some Events<\/strong> and modify the trigger to check if <code>Event Name<\/code> <strong>equals<\/strong> <code>select_content<\/code>. Give the trigger a name and save it.<\/p>\n<div style=\"aspect-ratio: 2758 \/ 938;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/configure-trigger.jpg\" title=\"Configure trigger\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"938\" width=\"2758\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/configure-trigger.jpg#ZgotmplZ\" alt=\"Configure trigger\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Once back in the tag editor, give your tag a name. It should now look like this:<\/p>\n<div style=\"aspect-ratio: 2754 \/ 1500;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/tag-config.jpg\" title=\"Tag configuration\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1500\" width=\"2754\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/tag-config.jpg#ZgotmplZ\" alt=\"Tag configuration\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>If happy, save the tag. Next thing to do is to <strong>Publish<\/strong> the container, so click the big blue <strong>SUBMIT<\/strong> button in the top right corner of the Google Tag Manager user interface.<\/p>\n<p>Give the version a name and click <strong>Publish<\/strong>.<\/p>\n<div style=\"aspect-ratio: 2836 \/ 646;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/publish-container.jpg\" title=\"Publish container\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"646\" width=\"2836\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/publish-container.jpg#ZgotmplZ\" alt=\"Publish container\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Once done, a summary screen should open, and you\u2019ll see a big blue <strong>Download<\/strong> button in the top right corner. Click that to download the container JSON.<\/p>\n<div style=\"aspect-ratio: 2622 \/ 712;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/download-container.jpg\" title=\"Download container\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"712\" width=\"2622\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/download-container.jpg#ZgotmplZ\" alt=\"Download container\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<blockquote>\n<p><strong>Note!<\/strong> Even though the GTM container is loaded over the network (as with web containers), the application loads with this downloaded container first, to account for scenarios where the user fails to download a fresh container e.g. due to network lag. Thus it\u2019s a good idea to <strong>always have the latest Google Tag Manager container version also included in the app assets<\/strong>.<\/p>\n<\/blockquote>\n<p>With the container JSON downloaded, you\u2019ll now need to create the directory in Android Studio. Expand the <code>\/app\/src\/main\/<\/code> directory in the Project view, and with <code>main<\/code> selected, click <strong>File<\/strong> -&gt; <strong>New<\/strong> -&gt; <strong>Directory<\/strong> from the Android Studio menu bar.<\/p>\n<div style=\"aspect-ratio: 1410 \/ 1070;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/new-directory.jpg\" title=\"New directory\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1070\" width=\"1410\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/new-directory.jpg#ZgotmplZ\" alt=\"New directory\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Name the directory <code>assets<\/code> and click OK.<\/p>\n<div style=\"aspect-ratio: 892 \/ 294;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/new-assets-directory.jpg\" title=\"New assets directory\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"294\" width=\"892\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/new-assets-directory.jpg#ZgotmplZ\" alt=\"New assets directory\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Next, select this new <code>assets<\/code> directory, and repeat the process of creating a new directory. This time, name the directory <code>containers<\/code>. You should end up with a tree structure that looks like this.<\/p>\n<div style=\"aspect-ratio: 876 \/ 544;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/assets-containers.jpg\" title=\"Assets and containers\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"544\" width=\"876\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/assets-containers.jpg#ZgotmplZ\" alt=\"Assets and containers\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Finally, drag the container JSON file from your downloads into this new <code>containers<\/code> directory, and click <strong>OK<\/strong> to approve the move. You should see the file in its correct place.<\/p>\n<blockquote>\n<p><strong>Note!<\/strong> It\u2019s important that the container JSON be located in this exact directory!<\/p>\n<\/blockquote>\n<div style=\"aspect-ratio: 1020 \/ 660;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/container-found.jpg\" title=\"Container found\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"660\" width=\"1020\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/container-found.jpg#ZgotmplZ\" alt=\"Container found\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Now, let\u2019s test it works!<\/p>\n<h2 id=\"step-7-debug-google-tag-manager-and-google-analytics\">Step 7: Debug Google Tag Manager and Google Analytics<\/h2>\n<p>First thing you\u2019ll need to do is enable some extra logging in Android Studio. With the <strong>Terminal<\/strong> tab open once more, type the following commands pressing Enter after each one. Note that <strong>you need to have your (virtual) device running<\/strong>.<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-text\" data-lang=\"text\">adb shell setprop log.tag.GoogleTagManager VERBOSE\nadb shell setprop log.tag.GAv4 DEBUG<\/code><\/pre>\n<\/div>\n<div style=\"aspect-ratio: 1296 \/ 288;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/debug-logging.jpg\" title=\"Debug logging\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"288\" width=\"1296\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/debug-logging.jpg#ZgotmplZ\" alt=\"Debug logging\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Next, click to open the <strong>LogCat<\/strong> tab, and re-run your application. Once the app is running, filter the <strong>LogCat<\/strong> view for the string <code>GoogleTagManager<\/code>. You should see logging that your container was loaded, and then a bunch of logging about processing Firebase events and such.<\/p>\n<div style=\"aspect-ratio: 1964 \/ 802;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/gtm-log-works.jpg\" title=\"GTM logging works\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"802\" width=\"1964\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/gtm-log-works.jpg#ZgotmplZ\" alt=\"GTM logging works\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Then, filter the LogCat for the string <code>D\/GAv4<\/code>. You should see a line with <code>Hit delivery requested<\/code> with a bunch of parameters matching those you configured in the Universal Analytics tag of Google Tag Manager, and then another line with <code>Hit sent to the AnalyticsService for delivery<\/code>.<\/p>\n<div style=\"aspect-ratio: 1608 \/ 294;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/ga-log-works.jpg\" title=\"GA logging works\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"294\" width=\"1608\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/ga-log-works.jpg#ZgotmplZ\" alt=\"GA logging works\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>If you see all that, then <strong>everything works<\/strong>, woohoo! If you\u2019re sending the data to an actual Google Analytics property where you have a Mobile App view running, you should see your event in the Real Time report.<\/p>\n<div style=\"aspect-ratio: 1948 \/ 378;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2019\/08\/ga-real-time.jpg\" title=\"GA Real time\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"378\" width=\"1948\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2019\/08\/ga-real-time.jpg#ZgotmplZ\" alt=\"GA Real time\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>There you have it! You\u2019ve built an Android application, which collects data to Google Analytics for Firebase, runs a Google Tag Manager container, and duplicates the Firebase event into a Universal Analytics endpoint.<\/p>\n<h2 id=\"summary\">Summary<\/h2>\n<p>This guide should serve as a very basic introduction to Android development. I wrote it because I think everyone even remotely interested in application analytics should understand the mechanisms of how Android application development works.<\/p>\n<p>When you integrate Google Analytics into your Firebase Project, a <a href=\"https:\/\/www.simoahava.com\/analytics\/getting-started-with-google-analytics-app-web\/\">Google Analytics: App + Web<\/a> is automatically created in the Google Analytics user interface. Thus you can leverage the new reports immediately, and if you end up having a website to complement the app, you could add website data to the property as a <strong>Web stream<\/strong>, too.<\/p>\n<p>Google Tag Manager for apps is quite far removed from its web counterpart. You have far less to work with due to how application\u2019s restrict the type of ad hoc code that can be run within.<\/p>\n<p>Firebase is also still a work-in-progress, and it still has many limitations that need to be sorted out before it\u2019s feasible to even think about replacing Universal Analytics with it.<\/p>\n<p>However, I hope you were bitten by the Android bug. It\u2019s a really fun platform to develop against, and Kotlin is a relatively simple language to learn, especially if you come from a JavaScript background. Here are some resources for further education:<\/p>\n<p>I hope you enjoyed the guide! Let me know in the comments if something was left unclear.<\/p>\n<\/p><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>With the release of Google Analytics: App + Web, Firebase is suddenly all the rage. The new App + Web property can combine data from your website and mobile apps, as long as the latter uses Google Analytics for Firebase, formerly known as Firebase Analytics. In this guide, I\u2019ll walk you through the steps of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":96561,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[12765,1046,43926,1531,14495,45593,1791],"dealstore":[],"offerexpiration":[],"class_list":["post-96560","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-analytics","tag-android","tag-firebase","tag-google","tag-manager","tag-quickstart","tag-tag"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Android Quickstart With Google Analytics For Firebase And Google Tag Manager - Som2ny Network<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fivemor.com\/?p=96560\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android Quickstart With Google Analytics For Firebase And Google Tag Manager - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"With the release of Google Analytics: App + Web, Firebase is suddenly all the rage. The new App + Web property can combine data from your website and mobile apps, as long as the latter uses Google Analytics for Firebase, formerly known as Firebase Analytics. In this guide, I\u2019ll walk you through the steps of [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=96560\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-02-19T02:08:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/android-quickstart-firebase-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1429\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"18 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=96560#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=96560\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"Android Quickstart With Google Analytics For Firebase And Google Tag Manager\",\"datePublished\":\"2025-02-19T02:08:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=96560\"},\"wordCount\":3445,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=96560#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/android-quickstart-firebase-scaled.jpg\",\"keywords\":[\"Analytics\",\"Android\",\"Firebase\",\"Google\",\"Manager\",\"Quickstart\",\"TAG\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=96560#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=96560\",\"url\":\"https:\/\/fivemor.com\/?p=96560\",\"name\":\"Android Quickstart With Google Analytics For Firebase And Google Tag Manager - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=96560#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=96560#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/android-quickstart-firebase-scaled.jpg\",\"datePublished\":\"2025-02-19T02:08:39+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=96560#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=96560\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=96560#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/android-quickstart-firebase-scaled.jpg\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/android-quickstart-firebase-scaled.jpg\",\"width\":2560,\"height\":1429},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=96560#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Android Quickstart With Google Analytics For Firebase And Google Tag Manager\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fivemor.com\/#website\",\"url\":\"https:\/\/fivemor.com\/\",\"name\":\"Som2ny Network\",\"description\":\"Daily Deals\",\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fivemor.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/fivemor.com\/#organization\",\"name\":\"Som2ny Network\",\"url\":\"https:\/\/fivemor.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"width\":300,\"height\":86,\"caption\":\"Som2ny Network\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/fivemor.com\"],\"url\":\"https:\/\/fivemor.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android Quickstart With Google Analytics For Firebase And Google Tag Manager - Som2ny Network","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fivemor.com\/?p=96560","og_locale":"en_US","og_type":"article","og_title":"Android Quickstart With Google Analytics For Firebase And Google Tag Manager - Som2ny Network","og_description":"With the release of Google Analytics: App + Web, Firebase is suddenly all the rage. The new App + Web property can combine data from your website and mobile apps, as long as the latter uses Google Analytics for Firebase, formerly known as Firebase Analytics. In this guide, I\u2019ll walk you through the steps of [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=96560","og_site_name":"Som2ny Network","article_published_time":"2025-02-19T02:08:39+00:00","og_image":[{"width":2560,"height":1429,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/android-quickstart-firebase-scaled.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"18 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=96560#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=96560"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"Android Quickstart With Google Analytics For Firebase And Google Tag Manager","datePublished":"2025-02-19T02:08:39+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=96560"},"wordCount":3445,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=96560#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/android-quickstart-firebase-scaled.jpg","keywords":["Analytics","Android","Firebase","Google","Manager","Quickstart","TAG"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=96560#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=96560","url":"https:\/\/fivemor.com\/?p=96560","name":"Android Quickstart With Google Analytics For Firebase And Google Tag Manager - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=96560#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=96560#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/android-quickstart-firebase-scaled.jpg","datePublished":"2025-02-19T02:08:39+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=96560#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=96560"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=96560#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/android-quickstart-firebase-scaled.jpg","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/android-quickstart-firebase-scaled.jpg","width":2560,"height":1429},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=96560#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"Android Quickstart With Google Analytics For Firebase And Google Tag Manager"}]},{"@type":"WebSite","@id":"https:\/\/fivemor.com\/#website","url":"https:\/\/fivemor.com\/","name":"Som2ny Network","description":"Daily Deals","publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fivemor.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fivemor.com\/#organization","name":"Som2ny Network","url":"https:\/\/fivemor.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","width":300,"height":86,"caption":"Som2ny Network"},"image":{"@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","caption":"admin"},"sameAs":["https:\/\/fivemor.com"],"url":"https:\/\/fivemor.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/96560","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=96560"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/96560\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/96561"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=96560"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=96560"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=96560"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=96560"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=96560"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}