I'm integrating AppsFlyer with Android Native Application. And I want to use Deferred Deep Linking, when user click landing page ads and download the app and upon first app open the user lands directly on the activity I want.
Link docs: https://support.appsflyer.com/hc/en-us/articles/207032096-Deferred-Deep-Linking-Getting-the-Conversion-Data
But I have not found a way to check that my code is running correctly.
Please help me with this problem
What was working for me is:
Add physical device as a test device in AppsFlyer (here's how to do it)
Enable Debug Mode in AppDelegate.swift in didFinishLaunchingWithOptions
AppsFlyerTracker.shared().isDebug = true
Add AppsFlyer methods in your AppDelegate.swift (as per article)
Remove app (or test build) from physical device
Open Deep Link from physical device, you will be redirected to App Store. Don't install app from the App Store!!! (just close it)
Install app via XCode
After it, on a first install it will call onConversionDataReceived method and the rest staff.
You're going to have to implement the onInstallConversionDataLoaded listener:
public interface AppsFlyerConversionListener {
void onInstallConversionDataLoaded(Map<String,String> conversionData);
void onInstallConversionFailure(String errorMessage);
}
This will return a map of all the parameters on the link that you clicked.
The parameter you need to pay attention to is the af_dp parameter.
This parameter should contain the URI scheme of the activity you want to route your users to. Make sure that you have set up this URI scheme properly in the manifest.
To create a tracking link you can use Link Management. It doesn't matter if it's a single platform link or a OneLink, as long as you have the af_dp parameter on the link, that parameter (along with all other parameters on the link) will be part of the response.
If you're still facing issues, feel free to reach out to support#appsflyer.com.
Related
We have couple of Firebase Dynamic links defined in our native Android application. For the first time users coming from a dynamic link and install the application, we would like to understand which dynamic link they're coming from.
My question is in order to do that, is there any way to fake the Play Store install from the dynamic link ? Because for the testing purposes I need to check which data is coming.
Example :
User clicks dynamic link https://myapp.page.link/qr/?id=123456
Redirected to Play Store
Installs the app and clicks Open from Play Store
Is it possible to know which URI does that Open button passes the app ?
In iOS it's easier to test. When user clicks a dynamic link and goes to App Store, you can run the codebase and install the app. And when app opens it still behaves like it's installed from App Store. But from Android side it doesn't work like that.
Hope it was explanative enough. Looking forward for suggestions.
For those who might be struggling about the same problem, here how I solved it.
First of all even though in the Firebase Dynamic Links Documentation it says that links will survive the Play Store installation process, it is not completely true. Like in my case
User clicks dynamic link https://myapp.page.link/qr/?id=123456
Redirected to Play Store
Installs the app and clicks Open from Play
Store
After the steps above when user opens the app, Firebase dynamic links listener will only get the base landing page which you set from Firebase console. So if you have a link link like this https://myapp.page.link/qr/?id=123456 your query params will get lost !
However it's still possible to understand which deeplink path did user click and install the application. Long story short it's the utmParameters. That variable is a Bundle comes with couple of extras and one of them is utm_campaign key. Which includes your deeplink name. See the code below :
Firebase.dynamicLinks
.getDynamicLink(intent)
.addOnSuccessListener(activity) { pendingDynamicLinkData ->
Log.v(
TAG, "pendingDynamicLinkData link : ${pendingDynamicLinkData?.link}" +
"pendingDynamicLinkData utmParameters : ${pendingDynamicLinkData?.utmParameters}"
)
pendingDynamicLinkData?.let {
// Check if it has your desired utm name
if(it.utmParameters.get("utm_campaign") == "Your Dynamic Link Name") {
//Do the job
}
}
}
.addOnFailureListener(this) { e -> Log.v(TAG, "getDynamicLink:onFailure $e") }
After the implementation, you can create an internal release for yourself and test the download flow from the Play Store.
I'm trying to implement Firebase dynamic links in my app.
I'm using custom domain of mine (instead of the one provided by firebase).
It works most of the time.
However, on a specific device (Samsung A7), the dynamic link is sometimes null
Here's the standard code for pulling the dynamic link:
FirebaseDynamicLinks.getInstance().getDynamicLink(intent).addOnSuccessListener { dynamicData ->
val link = dynamicData?.link
if (link != null)
{
Log.i(TAG, "pullDynamicLinkAsync", "dynamic link found")
}
}.addOnFailureListener {
Log.i(TAG, "pullDynamicLinkAsync", "dynamic link not found")
}
The steps of my test:
Click on the shared dynamic link -> Play store page of my app (previous version) gets opened
Make a fresh install of the app from Android Studio
Call the above code directly from onCreate method
As I said, most of the time it works and I get the link.
Could it be an issue related to the specific device? Maybe Play services issue? Or limitation?
EDIT (03/12/2020):
It seems like this issue is somehow related to Chrome browser.
When I press the dynamic link and the browser (in this case - chrome), opens, The following line gets printed in the log most of the time:
**I/ActivityManager: START u0 {act=com.google.firebase.dynamiclinks.VIEW_DYNAMIC_LINK ...**
If the line appears in the log, I always received the dynamic link in my app
If the lines doesn't appear in the log, I never receive the dynamic link in my app
The issue happens only with chrome browser.
If I open the link with other browser (Firefox, build in browser..) it always works.
We are using branch.io to pass custom data to App. For that we are following this steps in branch dashboard.
1) Ads -> Partner Management -> Facebook -> Create Facebook Link
2) Set data in Key/Value under "Deep Linking" Section (data which we need in our app)
3) We set Play/App Store URL in Android/iOs respectively Or set Default Redirects under "Redirects" section
That's it!!!
Now Go to Facebook Ads Manager and select App Install Campaign.
1) Select Play/App Store under App Section.
2) Set above generated URL under "deffered deep link"
You can read more here : https://docs.branch.io/pages/deep-linked-ads/facebook-app-install-ads/
Now Our Problem is :
When user clicked on any branch link with deep link params it able to receive data in both case when user fresh install the application and if user has already app installed.
When we clicked on Facebook ads with same url we are unable to get branch data if user has not installed application (Mostly in case when user redirect from App Store/play store) . But user has installed the app we can able to receive all branch data from same url.
So Question is:
1) Do we need any permission from Facebook or missing any configuration on Branch or Facebook?
2) The same thing will work with both (e.g. Android and iOs) devices?
Thanks
Unfortunately the branch.io documentation for setting this is up is pretty incomplete - we just spent about a week testing and debugging the SDK to figure out how to get it to work. The necessary changes itself are actually quite simple.
On Android:
Integrate the Facebook SDK if you haven't done so already
Ensure that the facebook_app_id string resource you added as part of (1) is not prefixed with "fb"
If you are using ProGuard, add rules to keep the relevant parts of the Facebook SDK
Call enableFacebookAppLinkCheck() on your Branch instance right after initializing it
On iOS:
Integrate the Facebook SDK if you haven't done so already
Call registerFacebookDeepLinkingClass(FBSDKAppLinkUtility.self) on your Branch instance right after initializing it
I had this exact same problem, but in a React Native project, so I'm using react-native-branch. #henning-dodenhof 's answer helped me a lot (thanks for figuring this out!), but I needed a couple of further adaptations, so I add this answer in case it's useful for someone else since this post was the main thing I found regarding this issue:
For iOS:
The FB SDK registration needs to happen before initializing Branch, not after as the above answer suggests. So, before this line that you add as part of the normal library setup:
[RNBranch initSessionWithLaunchOptions:launchOptions isReferrable:YES];
You need get the Branch instance from RNBranch and then register this FB SDK class:
[[RNBranch branch] registerFacebookDeepLinkingClass:[FBSDKAppLinkUtility class]];
Adding this new line before the initialization is critical, doesn't work if it's done after.
For Android:
Here the setup code already gets an instance with Branch.getAutoInstance(this), so we can just chain the registration:
Branch.getAutoInstance(this).enableFacebookAppLinkCheck();
It looks like the getAutoInstance above doesn't actually fully initializes the instance, so you can call enableFacebookAppLinkCheck right after, and the instance gets fully initialized after the first use.
I have an Adjust URI with for my app "myapp" for the method "mymethod" which calls 3 parameters: param1, param2, param3
as you can see here:
https://app.adjust.com/123abc?deep_link=myapp%3A%2F%2Fmymethod%3Fparam1%3D3.5516%26param2%3D3.5629%26param3%3D2016-10-16
If my app was already installed, everything works very fine and those 3 parameters are then aleady set on app start into the proper TextEdits already.
If my app was not installed, the Playstore is called, with the invitation to download the app. I have to press in PlayStore Open to start the app then, to start the app. But the 3 parameters were not set on startup?
EDIT: As you can see in the trailer that my deeplink is not online and the scheme has the form:
myapp://mymethod?param1=3.5516¶m2=3.5629¶m3=2016-10-16
Those parameters are taken over hand handed to this app. That means When I call that URI myapp starts with those paramters already set in the TextEdit's.
BUT when myapp was not installed, PlayStore is opened with myapp ready to be installed. Starting the myapp afterwards does not take over the parameters into that app (as in calling that URI with preinstalled myapp)
Is your deep link path immediately accessible after install? If there is a signup/login process that blocks access to that URI path, this could be why (Adjust docs).
Deferred deep linking is not a core part of the Adjust platform, so flexibility is somewhat limited. If you need a more comprehensive solution, you could check out Branch.io (full disclosure: I'm on the Branch team). The Branch platform gives you significantly more deferred deep linking options, and also integrates with Adjust to synchronize all your data.
I am using facebook sdk in my app for tracking of ads and install counts. Is there any way to know whether the source of new app install is facebook ad or not.
I read facebook sdk documentation but couldn't find a direct way to do it.
Facebook's mobile app install ads support deep linking. You can use that to send install attribution data into the app. This answer explains how.
I helped build and actively maintain a free deep linking platform called branch.io that can do this very easily for both Android or iOS. The tool leverages a public API that Facebook has to check if a new device came from a Facebook ad, app invite or whatever. You can read more about this public API here.
Let me explain how to set up and use it.
Head to dashboard.branch.io and create a Branch link. Add in labels for campaign, channel, etc depending on your use case. If you want to stuff custom parameters in, you can add unlimited keys/values in the deep link data section at the bottom.
Here's what it would look like: https://bnc.lt/m/3vk4ENnQcm
Once you have your Branch link, you're ready to make an advertisement. While creating your advertisement, you simply need to paste the link into the 'Deep Link' field as in the screenshot below.
Lastly, you want to know client side (after install) if the user came from an advertisement or not. To do this, you simply make a call to the Branch library in your App Delegate for iOS or splash Activity in Android. The callback block in the below example will contain all of the parameters of the link you created on the dashboard.
Branch *branch = [Branch getInstance];
[branch initSessionWithLaunchOptions:launchOptions
andRegisterDeepLinkHandler:^(NSDictionary *params, NSError *error) {
if (!error) {
NSLog(#"finished init with deep link params = %#", [params description]);
}
}];
I hope this helps!