Firebase Traffic Source Attribution Guide
How Firebase analytics attributes traffic source
Firebase analytics associates traffic attributes, such as source, medium, and campaign, to conversion events. Therefore, defining the conversion event is a fundamental component of any digital analytics measurement plan for Firebase analytics.
Conversion events in Firebase analytics measure how well your app fulfils your target objectives. It represents a completed user activity that contributes to the success of your business. Examples of conversion events include making a purchase (buying a ticket) or adding events to a bookmark.
By default following events are set as conversion events:
- first_open
- in_app_purchase
- app_store_subscription_convert
- app_store_subscription_renew
- purchase
Custom Conversion Events
We can also add our own events as conversion events which can allow us to measure how our marketing efforts contributed to important business goals.
To enable or disable an event as a conversion:
1- Go to the Events section under Analytics in the Firebase console
2- Turn on the switch in the ‘Mark as conversion’ column in the row for the event that you want to set as the conversion event.
You can enable up to 30 events per project as conversions, in addition to the five that Firebase defines by default.
Attribution information associated with an event is collected from the time of enablement forward.
Click on any one of your conversion events in the conversion section of the right panel to view the traffic sources given credit for those conversions. You’ll see a trendline of how frequently that event has occurred, along with a traffic source breakdown below it.
The Attribution Models
Attribution models are a set of rules that define which marketing activity gets credited for the conversion. The following attribution models are used to attribute the traffic source to the conversion events (source).
Cross-channel last click: Firebase looks at clicks from all sources and attributes the conversion to the last click. (Excluding direct*).
Cross-channel last engagement: Firebase attributes the conversion to the last click, or to an ad impression if there is no recent click. (Excluding direct*)
Google Ads preferred the last click: Firebase attributes the conversion to Google Ads whether or not there is a click from another source. (Excluding direct*)
Google Ads preferred last engagement: Firebase attributes the conversion to Google Ads whether or not there is a click or ad impression from another source. (Excluding direct*)
Note: All attribution models in Firebase exclude direct visits from receiving attribution credit unless a conversion cannot be attributed to any campaigns.
In addition to choosing an attribution model, you can also choose to see the origin of the events by Source, Medium, and Campaign, Network, Adgroup, and Creative.
Campaign Type in Firebase Analytics
Every marketing effort is targeted toward either making users download the application or re-engage them for an important business action. That is, an install-campaign or a re-engagement campaign. The following is how the traffic source is attributed to two types of campaigns in Firebase analytics.
Install Campaigns
The goal of an install campaign is to drive new installations of your app. Users who do not already have your app on their device are targeted and routed to the appropriate app store to download and install the app.
The attribution window for install campaigns is 30 days, and it is based on the “first_open” event, tracked by firebase automatically.
If a “first_open” event is attributed to a campaign, then all other conversion events moving forward are attributed to that same campaign until the attribution period expires in one year. The attribution window is renewed for one year with each subsequent conversion that occurs before expiration.
This means that suppose ‘first_open’ event gets attributed to facebook as source and medium as CPC and then after 2 weeks a user performs a conversion event (such as a ticket purchase) that event will also get attributed to Facebook/CPC as its source for one year.
Also, an attribution period is rolling one year which means each new conversion within the year extends the window another year from that period. So in our case of a purchase event, the conversion window will extend to one year from when the event occurred.
Note: You cannot adjust attribution windows.
Re-Engagement Campaigns
Re-engagement campaigns are designed to encourage customers to continue using your app after they have installed it. A conversion from a re-engagement campaign gets attributed twice.
- One to the campaign that got credit for the first_open event.
- Second to the re-engagement campaign.
Re-engagement campaigns can be both in-app and outside the app. In-app includes push notifications while outside the app are the same traditional campaigns but when clicked on a mobile device will open the application instead of a browser as the user already has the app installed on their mobile device.
Re-engagement campaigns can also send the user to specific screens of the application, to show them certain promotions or cross-sell them products. This can be done via dynamic links. We can easily create dynamic links in Firebase console.
Traffic Sources & Channels
Unlike Google Analytics, the Analytics console in Firebase doesn’t have channel grouping. Instead, source, medium, and campaign values are stored and viewed directly in Firebase conversion reports. Following are some of the common source medium that you will find in Firebase analytics
Direct/None
These are for campaign-less traffic that has not been associated with any campaign data with it.
This can happen when a user engages with the app but come from a source that analytics didn’t recognize, or when analytics wasn’t able to retrieve the traffic source information. Some examples of that include Apple Search organic links, Google Ads iOS Search App install campaigns, and other untagged/untracked campaigns.
Direct/none can also be attributed in the case when a user was referred to play store via a link that doesn’t have any tagged UTMs.
google-play/referral
These appear due to one of the following:
- The user was sent to the Play Store listing via a link that specified a referrer
- The user found the app organically by searching on the Google Play Store
Apple/Search
If an app is installed as the result of a click on an Apple Search Ad then you see the following data for conversion-related events
Note: You must add the iAd framework to the Xcode project file for your app in order to track Apple Search Ads.
(not set)
If any of the values of source medium, campaign, ad-network type, or creative is missing then analytics will show (not set) for that campaign event.
Campaign Traffic Information
Firebase can automatically capture the traffic from a limited number of sources listed here. For other platforms, the campaign source will be attributed to direct. Fortunately, there is a workaround to this which can help us to properly attribute data to its campaign source. To do so we will have to follow two steps:
1- Tag all the deep links with proper UTMs
In order to store custom campaign traffic, we have to ensure that all the links are tagged with UTMs. Google Play URL Builder can be used to help generate your custom URLs with UTMs.
2- Fetch UTMs from the deep link using code and send it to firebase analytics
I will demonstrate in Android but the same principle can be applied for iOS as well.
a). Add the dependency for the Dynamic Links Android library to your module (app-level) Gradle file (usually app/build.gradle
).
b). In the Firebase console, open the Dynamic Links section. Accept the terms of service if you are prompted to do so.
c). Add an intent filter for deep links in AndroidManifest.xml
:
d). Handle deep links using getDynamicLink()
method:
The above code sends the UTM parameter with the app_open
and campaign_details
event. The same technique can be used to send traffic information to the events with which we want to see traffic details.
e). You must call getDynamicLink()
in every activity that might be launched by the link, even though the link might be available from the intent using getIntent().getData()
. Calling getDynamicLink()
retrieves the link and clears that data so it is only processed once by your app.
Please refer to this Android Firebase documentation for further assistance and refer to iOS Firebase documentation to implement the same for iOS.
End Node
How traffic is attributed in any analytics platform is key to understanding how users get to our application. Conversion events in Firebase analytics help to store and analyze traffic sources. Hence, conversion events that are important to the business, should be turned on to understand marketing efforts for that conversion.
Also, Firebase itself doesn't track traffic attributes from unknown sources. However, we can send the UTM parameters as event parameters to capture traffic attributes from unknown sources. Doing so not only lets us monitor known traffic but also allows as to monitor unknown traffic sources in our analytics solution.