Firebase dynamic links campaign tracking not working - android

At work we are trying to use the optional campaign tracking UTM arguments when creating dynamic links through the firebase portal.
The dynamic links are working fine, and as far as I can tell from all the official documentation, just adding the UTM values in the final optional step when creating dynamic links should cause those values to be sent along with the dynamic_link_app_open event.
However, we are not seeing any attribution values when we look on the events OR conversions tabs for the dynamic_link_app_open event. We see that event is being sent but we just don't get the campaign attribution values so we have no idea what campaigns led to those events and conversions.
The documentation is really lacking on this particular feature and it's frustrating our marketing department which is ultimately ending up with the developers (i.e. me).
I have developed a work around, but it's a hack:
When creating the dynamic link on the firebase portal, I put utm_source, utm_medium and utm_campaign query strings directly into the deep link like so (not our actual deep link for security reasons, but you get the idea):
https://www.example.com?utm_source=Test&utm_medium=Test&utm_campaign=Test
Then in the client, I have added code to rip these out of the resulting deep link after passing the dynamic link through the firebase dynamic links SDK. With these 3 bits of information I can send an app_open event to firebase analytics via the FirebaseAnalytics SDK like so:
FirebaseDynamicLinks.getInstance()
.getDynamicLink(getIntent())
.addOnSuccessListener(this, pendingDynamicLinkData -> {
if (pendingDynamicLinkData != null) {
Uri optionalDynamicDeepLink = pendingDynamicLinkData.getLink();
if (optionalDynamicDeepLink != null) {
List<String> utmSource = optionalDynamicDeepLink.getQueryParameters(UTM_SOURCE);
List<String> utmCampaign = optionalDynamicDeepLink.getQueryParameters(UTM_CAMPAIGN);
List<String> utmMedium = optionalDynamicDeepLink.getQueryParameters(UTM_MEDIUM);
if (!utmSource.isEmpty() && !utmCampaign.isEmpty() && !utmMedium.isEmpty()) {
String utmSourceParam = String.valueOf(utmSource);
String utmCampaignParam = String.valueOf(utmCampaign);
String utmMediumParam = String.valueOf(utmMedium);
Bundle params = new Bundle();
params.putString(FirebaseAnalytics.Param.SOURCE, utmSourceParam);
params.putString(FirebaseAnalytics.Param.CAMPAIGN, utmCampaignParam);
params.putString(FirebaseAnalytics.Param.MEDIUM, utmMediumParam);
FirebaseAnalytics.getInstance(this).logEvent(FirebaseAnalytics.Event.CAMPAIGN_DETAILS, params);
FirebaseAnalytics.getInstance(this).logEvent(FirebaseAnalytics.Event.APP_OPEN, params);
}
String dynamicDeepLink = optionalDynamicDeepLink.toString();
if (!handleDeepLink(dynamicDeepLink)) {
Generic.openLinkInCustomTabs(getApplicationContext(), deepLinkOptional);
}
} else {
if (!handleDeepLink(deepLinkOptional)) {
handleIntent(intent);
}
}
} else {
if (!handleDeepLink(deepLinkOptional)) {
handleIntent(intent);
}
}
}).addOnFailureListener(this, e -> {
if (!handleDeepLink(deepLinkOptional)) {
Generic.openLinkInCustomTabs(getApplicationContext(), deepLinkOptional);
}
});
Whilst this works, it begs the question; what is the point of the optional campaign tracking section when creating dynamic links? Presumably putting the utm_source, utm_medium and utm_campaign there is supposed to allow firebase to auto-magically populate the dynamic_link_app_open event with said campaign tracking data, but it doesn't.
For instance, here is how I've setup that optional final step:
I have then followed the dynamic link into the app several times as well as asking testers to do the same. I have waited over 36 hours (as I'm aware these events can take some time to propagate to the cloud) and we're seeing dynamic_link_app_open events build up, indicating an event is logged for our dynamic links, but when we drill into that event there is no UTM information collected.
Is this feature of firebase broken?
I can see this from official firebase documentation (https://firebase.google.com/docs/dynamic-links/analytics):
Which indicates that collection of UTM data from dynamic link clickthroughs is not supported on firebase, but is supported on google analytics. This isn't confusing at all (/sarcasm).
So presumably some of our data (i.e. the bit to do with campaign tracking) is collected/hosted by google analytics?
To add further confusion, the official documentation for firebase dynamic links states:
"If you mark Dynamic Link events as conversions, you can see how your Dynamic Links are performing on the Attribution page."
And then shows an image of the firebase portal UI which doesn't even match to reality:
I've searched and searched for an attribution tab on the firebase console but there isn't one... these docs are enough to drive a developer insane.

I reached out to Google, as the Issue still does not seem to be solved. Here is the answer:
"Currently, Firebase Dynamic Links UTM event tracking for iOS platforms is not supported due to the fingerprint matching mechanism for iOS platform limitation. As an action, I’ve linked this support ticket to our existing feature request to let our engineering team know of the increasing interest to have this utm_ tracking mechanism implemented for the iOS platform for FDL. I can’t share definite details or timeline for the release, but we are taking your interest moving forward to have this feature improvements. You can check our release notes for any updates."
I don't understand what "the fingerprint matching mechanism" exactly means. But I understand that it will take years until this Issue gets fixed.

I can understand your frustration, we are in the same problem for months now. I also think it should not be the way it works that you need to manually pick up the UTM Parameters. And I did find an older screenshot (from 2019) that showed that Dynamic Links SHOULD do this on their own:
[
This first part still works, but the Source/Medium/Campaign never make it into the Acquisition/Attribution reports. They DID do that in the past:
(example in screenshot is another Dynamic Link than in the first screenshot, sorry)
In talks with Google, it sounded as if they were indeed aware of this as a bug, but offered no specifics on whether or when this would be fixed.
So I can only confirm that you are not alone with your problem...

2021 updated answer:
I guess the problem is fixed and now you can see the events of the dynamic link from the DebugView with all the params (as #Lukas Oldenburg said)

According to this answer:
UTM parameters that you choose in UI are parameters for mobile
tracking. If you want to pass UTM parameters to your "fallback"
website, you need to add them to the fallback address itself.

Related

Tracking when and which links are opened through my app

We have a social media kind of app where you can post content like messages, links, images etc. We would like to track when a link is pressed in the app, and which urls are opened through the app. The urls are detected in the textviews with the autolink "web" property. Is this possible to achieve with google/firebase analytics or similar?
although your question may not meet community standards.
I will try to answer, from my understanding ...
I believe that you are looking for URL tracking, this practice can be applied to applications and websites.
The most common method used today is:
Bit.ly
This tool, in addition to URL shortening. It can serve as an effective means of tracking and measuring.
but this tool also has its limitations. You have to study.
Google Analytics
With this tool you can create and use the Google Analytics tag.
So, follow this event.
It is understood that any url can be tracked with the created tag.
This practice becomes one of the most complex in metrics.
If you need to deepen your question further, be sure to comment.
Capture outbound links
Find out when users click a link to leave your site.
Note: This article applies only to sites tagged with the analytics.js snippet. (It does not apply to sites tagged with gtag.js.)
You can use Analytics Events to capture clicks on links that take users to a website other than your own.
Google Tag Manager
If you use Google Tag Manager to manage your Analytics installation, follow the instructions in Analytics Events to implement events.
Add the tag directly to your site
If you have added the Analytics tag directly to your site, you can copy and paste the script below into your own pages to set up Event measurement for outbound links. You should add this script in your page header, but not within the basic Analytics tag.
If you copy and paste this script exactly as it appears here, your outbound clicks will appear in your Analytics Events reports with a Category of "outbound" and an Action of "click". (In the snippet, these are shown in bold.) You can use these values, or change them and define your own values. Learn more about Event components.
This example assumes that you are using the analytics.js tag. See if you are using Classic Analytics (ga.js) or Universal Analytics (analytics.js).
<script>
/**
* Function that captures a click on an outbound link in Analytics.
* This function takes a valid URL string as an argument, and uses that URL string
* as the event label. Setting the transport method to 'beacon' lets the hit be sent
* using 'navigator.sendBeacon' in browser that support it.
*/
var captureOutboundLink = function(url) {
ga('send', 'event', 'outbound', 'click', url, {
'transport': 'beacon',
'hitCallback': function(){document.location = url;}
});
}
</script>
You'll also need to add (or modify) the onclick attribute to your links. Use this example as a model for your own links:
Check out example.com

How to view Adobe Launch data from Android app?

I want to see analytics in my android application, but am struggling to set Adobe Launch and Analytics up.
I have Mobile Core and Analytics set up in the app itself. And it isn't producing any errors on run.
MobileCore.setApplication(this)
MobileCore.setLogLevel(LoggingMode.DEBUG)
try {
MobileServices.registerExtension()
Analytics.registerExtension()
Lifecycle.registerExtension()
MobileCore.start { MobileCore.configureWithAppID("app-id-here") }
} catch (e: Exception) {
// Log
}
And have created the property in Adobe Launch adding the relevant extensions needed, setting up environments and publishing a library. I now have a library published. But have no idea how to view the data gathered from the app? Am I miss understanding what Launch is? Any help on this would be appreciated.
Once registeration is done you can able to see the logs in App logs "AdobeExperienceSDK" but to see the actual event you need to login on AEP dashboard portal.
For setup and instruction please visit below official url from Adobe Launch
https://experienceleague.adobe.com/docs/launch-learn/implementing-in-mobile-android-apps-with-launch/configure-launch/launch-install-the-mobile-sdk.html?lang=en#prerequisites
I may be misunderstanding your question, but if you're asking how to see an aggregation of the data you sent to Adobe, your request contains the address of the repo where you're sending your info. You need to log into Adobe Analytics to see what you sent.
You need to set the events to track the screen views. Example:
Analytics.trackState("Screen Name", null);
The oficial documentation:
https://docs.adobe.com/content/help/en/mobile-services/android/analytics-android/states.html
You can also use https://aep-sdks.gitbook.io/docs/using-mobile-extensions/adobe-experience-platform-assurance , which can let you see Adobe Launch console/debugging notes in the Adobe Griffon interface. A bit overkill for a one-time thing, but if you're going to be spending a lot of time withLaunch in your app, it might be worth setting up.

Firebase Dynamic Links - Can't get Url in android after install app from play store

If I install the app when clicking the dynamic link. All of that information from dynamic should be still available when I open the app for the first time.How can I get that information? It is not working when I use this: getInitialLink() returns Promise<string|null>;
Since, you haven't mentioned - I'm assuming you are having problems with shorter urls, if that's the case try putting the longer url.
Or refer here on Simon's answer: When I use the long instead of short links, everything works perfectly fine.
On Android, you use the getInvitation() method to get data from the Dynamic Link:
AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, this, false).setResultCallback
(/* ... */);
Then, in the callback, you can get the data passed in the Dynamic Links link parameter by calling the getDeepLink() method:
Firebase Documentation - Use Case
For future reference or detailed answer on Firebase Dynamic Links
Behave just like normal Links
In cases where the application doesn’t require installation (say, if it’s already installed) then clicking the Dynamic Link will automatically open the link to the desired screen.
Dynamic Links have a very simple process flow:
The user begins by clicking the Dynamic Link
If the the needs of the Dynamic Link target are satisfied (this is, the application being installed) then the user is navigated to the target location
Otherwise, if the application requires install in order to navigate
to the Dynamic Link target, the the user is taken to the point of
install for the application. Once the application has been installed,
the user is navigated to the target location of the Dynamic Link
And if that wasn’t all, we can integrate Dynamic Links with Firebase Analytics to track the interaction with any links that we generate for our applications. But if we only require simple tracking, then we can use the automatic built-in analytics from the Dynamic Links panel within the Firebase Console where we can also obtain attribution and referrer information for interacted links with no extra effort required from our side.
What makes it different from Google Analytics?
One of the first things that came to my mind when I read about Firebase Analytics was, “What about my Google Analytics setup?”. So if you already have Google Analytics in place, then why would you make the switch to Firebase Analytics? Well, here’s a couple of differences between the two:
Audiences
We can use Firebase Analytics to create Audiences — these are groups of users that we can then interact with using other Firebase service such as Firebase Notifications and / or Firebase Remote Config.
Integration with other Firebase Services
An awesome thing with Firebase Analytics is that we can integrate other Firebase services with analytics. For example, creating an Audience of users who have experienced a crash reported through Firebase Crash Reporting.
Lower Method Count
The Google Analytics dependency on Android has a total count of 18,607 methods and has a total of 4kb used for dependancies. On the other hand, Firebase Core (for Analytics) has a method count of 15,130 and only 1kb used for dependancies.
Automatic Tracking
When we add the firebase core dependency, it will automatically begin tracking a collection of user engagement events and device information for us — this is useful if you’re looking to only collect the minimal data for your app.
Unlimited Reporting
For up to 500 events, Firebase Analytics provides us with unlimited reporting straight out of the box for free!
No Singleton Initialisation
When setting up Google Analytics on Android we are required to initialize a Singleton instance. Firebase Analytics are simply available by fetching the instance directly from where we wish to track data. This isn’t much effort obviously but just makes the setup flow slightly easier.
Single Console
All of the data for every Firebase service is available for a single console. That makes it both easier and quicker for us to navigate from checking the analytic stats for our app to viewing the latest crash reports.
It looks like this is a react-native-firebase open bug for android
For fix the only thing that is required to be changed in module code:
private boolean isInvitation(PendingDynamicLinkData pendingDynamicLinkData) {
return FirebaseAppInvite.getInvitation(pendingDynamicLinkData) != null;
}
to
private boolean isInvitation(PendingDynamicLinkData pendingDynamicLinkData) {
FirebaseAppInvite invite = FirebaseAppInvite.getInvitation(pendingDynamicLinkData);
if (invite != null && invite.getInvitationId() != null && !invite.getInvitationId().isEmpty()) {
return true;
}
return false;
}
Bug reference : https://github.com/invertase/react-native-firebase/issues/1273
Please Check Your Manifest file
open AndroidManifest.file => In your activity tag there is intent-filter tag put below line in that tag.
<data android:scheme="https" android:host="your.dynamic.link" />
<data android:scheme="http" android:host="your.dynamic.link" />
If already done then check this link for the full blog on the dynamic link with react native.
Link: http://blog.logicwind.com/react-native-dynamic-links-using-firebase/
I hope this will help. sorry for the typos.

Firebase DynamicLinks - Can i see analytics of link created by the new buildShortDynamicLink API?

I'm using the new buildShortDynamicLink API of Firebase (And it's great).
And i see there are two methodes for the ShortDynamicLink result:
Uri shortLink = task.getResult().getShortLink();
Uri flowchartLink = task.getResult().getPreviewLink();
I tried to use both but still the link doesn't apear in the Firebase dashboard.
What is getPreviewLink used for anyway?
Thanks.
Only analytics for links created in the console will show up in the console.
You can still access the analytics for your short links created via the API by using the Firebase Dynamic Links Rest API as described here (https://firebase.google.com/docs/reference/dynamic-links/analytics).
The getPreview returns the url to a visual flowchart that helps illustrate clearly how the link will work in each context. You can use it to debug the link if you want and to visually see how it will behave in different contexts.
Full disclosure: I work for Firebase.
This is expected. Only links created through the dashboard will show up there.
Think about it from this perspective: when your users are creating hundreds or even thousands of links per day, it will quickly make the dashboard completely useless if they all show up there.
At Branch.io (full disclosure: I'm on the Branch team), we take the same approach by default, though we do offer a manual flag you can change on programmatically-generated links to have them show up on the dashboard if desired.

How to move from Google-Analytics to Firebase-Analytics?

Background
In the recent months, Google has published a new Analytics alternative, called "Firebase Analytics" .
The problem
As the app already does have Google-Analytics, I find some obstacles that I can't see how to best handle.
The questions
Previously, "newTracker" function needed a property-id. Now I don't see it. Does it mean it doesn't need one?
Previously, "enableAdvertisingIdCollection " was available to collect ads info too. I can't find it in new APIs. Is it automatically collected?
"setDryRun" was available to disable sending the data to the servers, and now I don't see it. Does it mean it's automatically this way for debug versions of the app? Do all functions write to the logs?
Previously, I could track a "screen" :
public void setScreenName(String name) {
mGoogleAnalyticsTracker.setScreenName(name);
mGoogleAnalyticsTracker.send(new HitBuilders.ScreenViewBuilder().build());
}
Now I don't see it, but as I've read, I think it's automatic, so it sends data of the activity lifecycle anyway. Is it true?
Probably the most important thing: previously I could track using category, action, label and value:
public void trackEvent(final String category, final String action, final String label, final long value) {
mGoogleAnalyticsTracker.send(new HitBuilders.EventBuilder()
.setCategory(category).setAction(action)
.setLabel(label).setValue(value).build());
}
and now I see a completely different way to track events ("custom events"), using bundles. Example:
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, id);
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, name);
bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "image");
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
How does it work? How is it shown in the website of Firebase Analytics? I suppose I could have the first parameter of logEvent behave like the category parameter of the Google-Analytics, but what can/should I do for the rest? According to the docs, this should be ok:
public void trackEvent(final String category, final String action, final String label, final long value) {
Bundle bundle = new Bundle();
bundle.putString("action", action);
bundle.putString("label", label);
bundle.putLong("value", value);
mFirebaseAnalytics.logEvent(category, bundle);
}
Which events are actually automatically being tracked (I ask this because some are said that I shouldn't use, here) ? Do they include purchases? app-invites? ads? Where do I see them in the console website ?
About logs, it says that the new SDK does it by :
You can enable verbose logging with a series of adb commands:
adb shell setprop log.tag.FA VERBOSE
adb shell setprop log.tag.FA-SVC VERBOSE
adb logcat -v time -s FA FA-SVC
What do those commands do? How can I disable it? I've noticed it even gets shown in release version of the app...
Is the new SDK supposed to replace Google-Analytics? Is it suggested to fully move to it? Will Google-Analytics have any updates?
Lots of questions bundled together so I'll try to briefly answer most of them:
Google Analytics reports on tracker-ids, Firebase Analytics reports on applications. There is only one id in the application defined in your google-services.json. The ID is translated to a string resource by google services plugin under "google_app_id" name. All events from the app are reported to this single id.
Firebase Analytics reports AdId automatically. You don't need to enable it.
There is no dryRun feature. You can either use separate google-services.json during development, filter out development version using the app version or add user-property to mark the app instances used for development.
You can report screens with
Bundle params = new Bundle();
params.putString(FirebaseAnalytics.Param.ITEM_CATEGORY, "screen");
params.putString(FirebaseAnalytics.Param.ITEM_NAME, "screen name");
firebaseAnalytics.logEvent(FirebaseAnalytics.Event.VIEW_ITEM, params);
You can log custom event with the same params
Bundle params = new Bundle();
params.putString("category", category);
params.putString("action", action);
params.putString("label", label);
params.putLong("value", value);
firebaseAnalytics.logEvent("xyz_event", params);
The "ga_" prefix is reserved and your analytics will fail if you use it. Instead, use "xyz_" where xyz is your company's initials, for example.
Do not use the category as event name unless you have very few categories you want to track. Firebase Analytics supports up to 500 event names. Logging more than that will cause some of your data to be ignored.
There is a list of reserved event names in the beginning of the FirebaseAnalytics.Event class. It roughly represents the automatic events reported.
Firebase Analytics has debug logging disabled by default. It only logs errors and warnings. If you don't enable debug logging and your app is correctly configured there are only 2 lines that are being logged when the app starts with instructions on how to enable debug logging. There is nothing to disable in production and there is no equivalent to setLogLevel(ERROR) from Google Analytics. WARN is the default logging level. You can only enable logging on individual device by running the adb command on the device). That helps you avoid shipping app in production with debug logging enabled.
Google Analytics SDK for Android and iOS is not deprecated and will be supported and updated for foreseeable future. You don't need to move away from it if you already invested using it in your app and it is meeting your needs.
Google Analytics is a freemium web analytics service offered by Google that tracks and reports website traffic.1 Google launched the service in November 2005 after acquiring Urchin.
Firebase is a cloud services provider and backend as a service company based in San Francisco, California. The company makes a number of products for software developers building mobile or web applications.
How to move from google analytics to firebase analytics?
Google Analytics (GA) and Firebase Analytics (FA), despite their common name, are widely different in many aspects.
While GA is a general-purpose (and more web oriented) analytics tool, Firebase was built keeping mobile in mind: therefore, the feature set is different between the two, with some things that were added in FA and things that are missing from GA.
More specifically, these are some noteworthy points when considering Firebase Analytics:
Real-time view is missing
Events are available after a 4-6 hours period
Behavior Flow (from GA) is missing
The Audiences feature a big advantage of FA and, coupled with Notifications, allows you to engage with a specific group of users
When using Firebase Crash Reporting, an audience with users who experienced a crash is automatically created
Funnel analysis makes much more sense than in GA, since FA is based on events and not on screen views
Free and unlimited, except for the number of types of events (limited to 500); no limits on the volume of events per each type
Some events are logged automatically (i.e., sessions based on Activity lifecycle)
Relatively low methods footprint, compared to GA's methods count
Dead-easy to setup, there is no singleton to initialize, just include the Gradle dependency and start logging events
All-in-one console, if you plan on using other Firebase services
As to if one should consider switching from one to the other, or if to keep both in parallel, the answer is: it depends.
If you were using GA extensively before, chances are that you would be missing some of its feature when switching completely to FA.
However, if this is a fresh start for your project, FA is much more prone to a cross-platform mobile-oriented environment, so you may very well consider it as your own analytics tool.
On a side note, keep in mind that Firebase has just launched and Google has plans on adding more features in the coming weeks (e.g., real-time dashboard).
For tutorial you can find here https://firebase.google.com/docs/analytics/android/start/

Categories

Resources