iOS: How to track firebase dynamic link - ios

i have added UTM parameter using FIRDynamicLinkGoogleAnalyticsParameters
FIRDynamicLinkGoogleAnalyticsParameters *analyticsParams =
[FIRDynamicLinkGoogleAnalyticsParameters parametersWithSource:Source
medium:Medium
campaign:Campaign];
analyticsParams.term = Term;
analyticsParams.content = Content;
components.analyticsParameters = analyticsParams;
Now i want to track the dynamic link like this,
if i have shared on Facebook, any one tap on that link then it will go to application if there else it will go to App Store.
After i need to show message based upon it’s source i.e welcome from Facebook like message.
So can we track dynamic link and check from where the link has been tapped and show relevant message based upon i’t source.
Can anyone explain how to implement this:
https://firebase.google.com/docs/dynamic-links/analytics
By adding these tracking parameters to your Dynamic Links, Google
Analytics and iTunes Connect can treat them like any other campaign
it's measuring attribution reporting for, and you can view conversion
events not just by the ad campaigns responsible for bringing in those
users, but also by which Dynamic Links might have brought them in.
The following parameters are passed to Google Analytics: utm_source,
utm_medium, utm_campaign, utm_term, utm_content, gclid
The following parameters are passed to the App Store: at, ct, mt, pt
The same question was asked in this thread:
App link tracking with Firebase

Also I had posted this question on Firebase GitHub and got the reply:
https://github.com/firebase/firebase-ios-sdk/issues/4775
You can't track where the link was tapped from unless you create a
custom link (or add custom parameters) for each source, but even then
this will result in mismatches if a user ever copies a link and shares
it to a different source.

Related

Is there a way to recognize, that the app was installed thru firebase dynamic link in didFinishLaunchingWithOptions?

I am implementing firebase dynamic links in my iOS app and I can already parse the link, redirect to AppStore etc. Now I want to distinguish the first run of the app, when user installs it from the dynamic link - I want to skip the intro and show him the content that is expected to be shown.
Is there some parameter, that I could catch in application(_:didFinishLaunchingWithOptions:) so I could say that it was launched thru the dynamic link?
The method application(_:continueUserActivity:userActivity:restorationHandler:) is called later, so the intro is already launched.
This case is difficult to test, because you have to have your app published on the AppStore.
You actually don't need to have the app published in the App Store for this to work — clicking a link, closing the App Store, and then installing an app build through Xcode (or any other beta distribution platform like TestFlight or Fabric) has exactly the same effect.
According to the Firebase docs, the method that is called for the first install is openURL (no, this makes no sense to me either). The continueUserActivity method is for Universal Links, and is only used if the app is already installed when a link is opened.
I am not aware of any way to detect when the app is opening for the first time after install from a 'deferred' link, but you could simply route directly to the shared content (skipping the intro) whenever a deep link is present. If a deep link is NOT present, show the regular intro.
Alternative Option
You could check out Branch.io (full disclosure: I'm on the Branch team). Amongst other things, Branch is a great, free drop-in replacement for Firebase Dynamic Links with a ton of additional functionality. Here is an example of all the parameters Branch returns immediately in didFinishLaunchingWithOptions:
{
"branch_view_enabled" = 0;
"browser_fingerprint_id" = "<null>";
data = "{
\"+is_first_session\":false,
\"+clicked_branch_link\":true,
\"+match_guaranteed\":true,
\"$canonical_identifier\":\"room/OrangeOak\",
\"$exp_date\":0,
\"$identity_id\":\"308073965526600507\",
\"$og_title\":\"Orange Oak\",
\"$one_time_use\":false,
\"$publicly_indexable\":1,
\"room_name\":\"Orange Oak\", // this is a custom param, of which you may have an unlimited number
\"~channel\":\"pasteboard\",
\"~creation_source\":3,
\"~feature\":\"sharing\",
\"~id\":\"319180030632948530\",
\"+click_timestamp\":1477336707,
\"~referring_link\":\"https://branchmaps.app.link/qTLPNAJ0Jx\"
}";
"device_fingerprint_id" = 308073965409112574;
"identity_id" = 308073965526600507;
link = "https://branchmaps.app.link/?%24identity_id=308073965526600507";
"session_id" = 319180164046538734;
}
You can read more about these parameters on the Branch documentation here.
Hmm... as far as I'm aware, there's not really anything you can catch in the application:(_:didFinishLaunchingWithOptions) phase that would let you know the app was being opened by a dynamic link. You're going to have to wait until the continueUserActivity call, as you mentioned.
That said, FIRDynamicLinks.dynamicLinks()?.handleUniversalLink returns a boolean value nearly instantly, so you should be able to take advantage of that to short-circuit your into animation without it being a bad user experience. The callback itself might not happen until several milliseconds later, depending on if it's a shortened dynamic link (which requires a network call) or an expanded one (which doesn't).

Facebook iOS deep linking - can't parse request_ids since target_url is missing

First I just want to state that I already know this question exist. It is somewhat similar to mine. But since I don't have enough reputation I couldn't comment and ask if there was any progress on the issue.
Ok, so I'm trying to retrive the request_ids from the target_url, as per the Facebook docs. When the user taps on a request in the native Facebook iOS app, iOS switches to my app, and when I try to process the app launch url in order to parse out the request_ids, I can't even find the target_url.
The launch url should look something like:
fb00000000000000://authorize/#access_token=00000000000000&expires_in=86400&target_url= http://m.facebook.com/apps/friendsmashsample?fb_source=notification&request_ids=abc&ref=notif&app_request_type=Duser_to_user
But in my case the target_url is missing, and instead it looks like:
fb00000000000000://authorize/#access_token=0000000000000&expires_in=86400
So my question is: How do I get the target_url, so that I can parse the request_ids in order to deep link in my app?
Thanks!

Parse SDK iOS Analytics

I am working with Parse SDK in my iOS Application. I have integrated Parse Facebook SDK with my Application. I just want to do an analytics based on Users not overall count like we can give read count or something. (e.g) I want to do know the current user's access count of modules which I am having in my application and overall How many users have visited the particular module in certian period of time.Please help me out on this.Thanks in advance
What you are looking for is the [PFAnalytics trackEvent: dimensions:] call. This allows you to track an event with a particular name as an NSString and provide dimensions as an NSDictionary.
Here's an example of what you could put in the loading code for each module:
NSDictionary *dimensions = #{
// Define the user via whatever unique ID you use
#"user": userId,
// Define the name of the module that is being loaded
#"module": #"moduleName",
};
// Send the dimensions to Parse along with the 'search' event
[PFAnalytics trackEvent:#"moduleLoad" dimensions:dimensions];
To get a total number of events, you will need to use the Parse.com dashboard. You may also need to download the events log and sum it via Excel.
Also, if you are looking for analytics tracking that is more robust at the user-level, I recommend http://www.mixpanel.com

iOS 8 UIActivity: disable specific third-party sharers?

I'm fighting with UIActivityViewController in iOS 8. I'd built a custom Pinterest sharing mechanism which works beautifully in iOS 7 -- specifically, it uploads an image to my server, and then creates a Pin with that image and a URL which I specify. This is the desired functionality.
Now, in iOS 8, Pinterest has implemented its own sharer, which accepts either a URL or an image. If a URL is included in the list of Activity Items, the sharer pops up and asks the user which image s/he wants to share from the page at that URL, and totally ignores the image which is also in the list of Activity Items. If there's no URL, and just the image, then the uploaded pin doesn't include a URL.
In order to resolve this, I need to do one of these things:
Disallow Pinterest's sharer from appearing in the list, so my customized sharer can show up instead;
Somehow specify a Source URL within a pin of an image using Pinterest's sharer (I doubt this is possible);
Remove all the other images from the generated web page. I'd really rather not do this.
Or if all else fails, it would be useful to at least be able to detect if the user has Pinterest's sharer selected to show up in their list.
Does anyone know if there's a way to achieve any of these things?
Just an idea, you could set a custom UIActivitySource on your UIActivityViewController.
Then check the incoming activity type for Pinterest. Then disable that via the exclusions.

Browser extension overriding browser functionality / url

Is it possible to create a browser extension which can change where the user is taken?
I.E. If the user puts in a certain prefix or symbol the browser will not attempt to go to the address supposedly determined by the rest of the string or search Google, etc. for the rest of the string?
E.G. YT:sdfs232 would resolve to http://www.youtube.com/watch?v=sdfs232. I'm not specifically looking to do that, it's just an example.
You don't need a new extension or Greasemonkey to do this. Firefox has had this capability for a long time.
Just use a bookmark keyword search.
For example, create a new bookmark:
Press CtrlShiftB to open the bookmark library.
Right-click wherever you want it, and select New Bookmark....
Fill in the Name: Youtube.
Fill in the Location: http://www.youtube.com/watch?v=%s
Note the %s.
Fill in the Keyword: YT.
Fill in the Description: Handy direct shortcut to a video ID.
Give it tags, if you wish.
Click the Add button.
Now you have a handy flexible shortcut.
Test this one by entering YT dQw4w9WgXcQ into the address bar.
See the article for more information.
What your looking for is called a URL Scheme. http, ftp, ssl are all URL Schemes and you can define your own on any platform you want.
This is possible, and is used quite a lot by for example by IPhone apps to launch another iphone app from a browser window when the user clicks on a link. Thats how the iphone jumps from safari to itunes app.
More details here including most common schemes http://en.wikipedia.org/wiki/URI_scheme
This link gives basic info on registering a scheme on windows
http://msdn.microsoft.com/en-us/library/ie/aa767914(v=vs.85).aspx
Ususally they are used to open a seperate application though rather than simply a differnt url, but you could do what you want with a plugin.

Resources