# Creating a cross-platform report on Google Analytics using Batch and the Firebase event dispatcher

During the summer of 2019, Google announced a [new feature](https://www.blog.google/products/marketingplatform/analytics/new-way-unify-app-and-website-measurement-google-analytics/) allowing marketing teams to merge analytics from mobile applications and websites into one tool. The feature is now available as a beta on Google Analytics new properties *App + Web.* It gives access to the new *Analysis hub*, where both data from your website and your applications are available.

Today we are going to set up your Firebase and Google Analytics accounts to make these new features available with the data of the Batch SDK.

{% stepper %}
{% step %}

## Wiring up the Batch SDK to Firebase

First, we need to wire up Batch SDK to Firebase. The easiest way to achieve this is to install the Firebase Events Dispatcher into your application. This small plugin will make Batch's data available on your Firebase dashboard.\
More details are available in our technical documentation for [Android](https://doc.batch.com/developer/sdk/android/event-dispatchers) and [iOS](https://doc.batch.com/developer/sdk/ios/event-dispatchers).
{% endstep %}

{% step %}

## Linking your Firebase project to your Google Analytics <a href="#id-2-linking-your-firebase-project-to-your-google-analytics" id="id-2-linking-your-firebase-project-to-your-google-analytics"></a>

Once your Firebase project is created and set up with the Batch SDK (and the dispatcher installed), you need to link your Firebase project to a Google Analytics property.

Go to your [Firebase dashboard](https://console.firebase.google.com/), select your project, click on the ⚙️ in the top left corner, and then on *Project settings*. On the new page, click on the *Integrations* tab.

### a. My Firebase project isn’t linked to GA <a href="#a-my-firebase-project-isnt-linked-to-ga" id="a-my-firebase-project-isnt-linked-to-ga"></a>

Depending on your Firebase configuration, you might not have enabled Google Analytics for your project.&#x20;

<figure><img src="/files/ddxXalB3tBZXPepfIF4k" alt="Enable Google Analytics"><figcaption><p>Enable Google Analytics</p></figcaption></figure>

If you see the option *Enable* on the card, then you need to choose or create a Google Analytics account on which your applications' data will be linked (a new property *App + Web* will be automatically created in the selected Google Analytics account).

### b. My Firebase project is linked to GA <a href="#b-my-firebase-project-is-linked-to-ga" id="b-my-firebase-project-is-linked-to-ga"></a>

If your Firebase project is already linked, you need to make sure to upgrade your link to gain access to the new beta features.&#x20;

<figure><img src="/files/ddxXalB3tBZXPepfIF4k" alt="Upgrade your link"><figcaption><p>Upgrade your link</p></figcaption></figure>

To do so, click on *Manage* then under your Google Analytics configuration, a banner will offer you to *Begin upgrade*, click on it, then choose or create a Google Analytics account on which your applications' data will be linked (a new property *App + Web* will be automatically created).

<figure><img src="/files/gXNvmtLgkVgL8FzVempU" alt="Your Google Analytics property"><figcaption><p>Your Google Analytics property</p></figcaption></figure>

*Note: If you can't see the banner, it's probably because your Google Analytics link has already been upgraded, simply move on to the next step.*
{% endstep %}

{% step %}

## Merge my website and app data <a href="#id-3-merge-my-website-and-app-data" id="id-3-merge-my-website-and-app-data"></a>

Go to your [Google Analytics dashboard](https://analytics.google.com/analytics/web/), you should see a new property in your account, labelled as *App + Web:*

<figure><img src="/files/ZaNqn1xJgLexfPVDDfsY" alt="Your analytics account"><figcaption><p>Your analytics account</p></figcaption></figure>

Select that new property, then click on *⚙️Admin* in the bottom left corner, then click on *Data Streams* in the property column. Under the *All data streams* tab, you should see your applications (Android and/or iOS) from your Firebase project (if you do not have any applications in your Firebase project, then click the *Web* button).

Click on the *Web* tab, and move on to the next step.

### a. I don’t have Google Analytics on my website <a href="#a-i-dont-have-google-analytics-on-my-website" id="a-i-dont-have-google-analytics-on-my-website"></a>

If you don’t have Google Analytics on your website, you can add one now, data will be directly merged with your application’s data.

On top of the form, fill in the *Website URL* and *Stream name* of which you want to track data and then click *Create Stream*.

*Optional*: Click on the *Web* tab, and under *Tagging Instructions* > *Add new on-page tag* follow the instructions to add Google Analytics to your website. If you don’t know how to do it, you can skip this step but keep in mind that your website data won’t show on your dashboard.

### b. I already have Google Analytics on my website <a href="#b-i-already-have-google-analytics-on-my-website" id="b-i-already-have-google-analytics-on-my-website"></a>

If you already have Google Analytics tracking your website, you need to fill in the exact same *Website URL* as in your property (you can find it under *⚙️Admin* > *Property Settings* > *Default URL*), also fill in the *Stream name* input, then click on *Create stream*.

Now under *Tagging Instructions* > *Use existing on-page tag*, expand the Google Analytics block and follow the instructions to add your new Measurement ID to your existing property.

Congratulations! You have successfully set up the new Google Analytics dashboard App + Web. You can now access data from your website and your app on the same dashboard, take a look around, for example under *Technology* in the left menu, you can now inspect platform-specific metrics.

<figure><img src="/files/f9OQhETkfToZinDTsEHx" alt="Inspect platform-specific metrics"><figcaption><p>Inspect platform-specific metrics</p></figcaption></figure>

*Note: you may have to wait 24 hours to see website data in your dashboard, but if you can see the Technology > Web option in your menu, your configuration is done.*
{% endstep %}

{% step %}

## Create and tag your campaigns <a href="#id-4-create-and-tag-your-campaigns" id="id-4-create-and-tag-your-campaigns"></a>

Now that everything is set up, you need to send campaigns to create data on your Firebase and Google Analytics project.<br>
{% endstep %}

{% step %}

## Use Batch data on my dashboard <a href="#id-5-use-batch-data-on-my-dashboard" id="id-5-use-batch-data-on-my-dashboard"></a>

Now that you have data on your dashboard, we will need to flag specific events and parameters from the Batch SDK. To achieve this, go back to your [Firebase dashboard](https://console.firebase.google.com/), and click on *Analytics* > *Events* in the left menu.In the list you should see events starting with *batch :*&#x200B;

<figure><img src="/files/WogDM3STgDrwn6zBY1ns" alt="Find your Batch events"><figcaption><p>Find your Batch events</p></figcaption></figure>

If you can’t see them, make sure the Firebase dispatcher is correctly installed and working (you can send a test push from the Batch dashboard to create events on your Firebase Dashboard).

### a. Configure parameters <a href="#a-configure-parameters" id="a-configure-parameters"></a>

For each Batch event, a set of parameters is available (corresponding to your UTM tags), to set one click on the three dots at the end of the line of any batch event and click *Edit parameter reporting*, in the modal, you can add any of the following parameters (always as Text type).Here is an example of the *batch\_in\_app\_show* event after being configured:

<figure><img src="/files/yimuwTJu2rpk070tSTEm" alt=""><figcaption><p>Set up parameter reporting</p></figcaption></figure>

*Note: you’re limited to 50 text parameters per Firebase project, so you should only set up parameters that you want to use in your reports, if you don’t know which one to use yet, start with the campaign parameter and move on to the next step.*

### b. Create my first report in Google Analytics <a href="#b-create-my-first-report-in-google-analytics" id="b-create-my-first-report-in-google-analytics"></a>

Go back to [Google Analytics dashboard](https://analytics.google.com/analytics/web/), click on *Analysis* > *Analysis Hub*, then click on the + card on top of the page to create a new analysis.In the left menu click on the + next to *Dimensions*, in the list showing on the right side of the screen you should find the parameters you have added on the Firebase dashboard, check them to add them to your analysis.&#x20;

<figure><img src="/files/7YZB1BiQJkvIRHtZxkxA" alt="Add your dimensions in your analysis"><figcaption><p>Add your dimensions in your analysis</p></figcaption></figure>

You can now use those dimensions to draw graphs and tables!

<figure><img src="/files/Qcbcavp7ZXBqZWagLErs" alt="Create graphs and tables"><figcaption><p>Create graphs and tables</p></figcaption></figure>
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.batch.com/integrations/analytics/creating-a-cross-platform-report-on-google-analytics-using-batch-and-the-firebase-event-dispatcher.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
