How to track referrals when website is opened from mobile app - facebook

I am wondering if it's possible to track referrals when my website is opened from mobile app? Is there any related information provided in request headers?
Particularly interested to know if it's opened from Facebook mobile app or Instagram mobile app.

Look for the utm_source and utm_medium request parameters on your website. If they don't exist, then the best you're going to get is the user-agent of the device. Alternatively, if you're keen to always use bit.ly type shortened links, you could use a different one everywhere you post the link.

Related

How to invoke external apps from my Codename One app

I have developed an app for organizing and grouping of hashtags. One functionality I want to add to this app is the following: The user can copy his/hers tags and then should be able to switch to the desired social media app (in fact app or web page). Starting a web page is not a problem but how can I switch to another app (twitter, tumblr, youtube, facebook, atc. etc.) from my own app? I couldn't find any solution for that. Please help!
The complete list of apps I want to start is: Facebook, GooglePlus, Instagram, LinkedIn, Pinterest, Tumblr, Twitter, Vine, Vk, Youtube
You can just use Display.execute to launch Android/iOS apps implicitly e.g. this site lists the URL schemes for various apps including facebook.
On iOS you can also check if an app is already installed using the Display.canExecute(String) API.
For Android I couldn't find a conclusive list of URL's like that but generally googling "intent URI" with your desired network should provide you with the answer.

New Facebook Messenger integration doesn't support URL Scheme Suffix?

I'm developing a 2nd version of our app for Facebook Messenger to meet their new platform integration requirements described here:
https://developers.facebook.com/docs/messenger
I'm attempting to allow both apps to share the same Facebook App ID. This page from the iOS troubleshooting docs has a section on Sharing an app ID across Apps
https://developers.facebook.com/docs/ios/troubleshooting#testsharedialog
It shows you how to add URL Scheme Suffixes to your apps so that they can both live on the same phone yet share the same Facebook App ID.
I've done this and it works successfully so that both apps can use Facebook login without stepping on each others toes. However, it seems that doing so broke my integration with FB messenger, which was previously working.
After following the instructions on the troubleshooting link above and adding the fields for the URL Scheme suffix, the videos I send to FB messenger no longer have a Reply button on them. Media inside Messenger that was sent from my app no longer contains any tappable element that takes you back to my app.
Does anyone know if there's a way to get the URL Scheme Suffix working in a way that it still works with the new Messenger Platform?
Thanks!
Heard back from Facebook directly on this. Their response:
No it doesn't. Because we will try to open the scheme without suffix. How would we know which suffix you want to open from messenger? ... So no suffixes are not supported. Just use a different app id.

Should Facebook canvas apps behave same if opened from original non-canvas site url?

This is a first time I am trying to make a facebook application/game, and I have couple of questions.
Let's say canvas url is http://mysite/first_app/ and facebook app url is https://apps.facebook.com/first_app
I wonder if visited both url-s should a functionality be the same? I mean does facebook give you more tools and freedom if navigated from https://apps.facebook.com/first_app? Or should both url-s look and do the same thing? Is it possible?
I wonder if visited both urls should a functionality be the same
Of course yes. The difference is just that one is deployed at the facebook's app center and the other at your domain.
Yes, you have more tools available in the canvas ("apps.facebook.com.."), as it will send you the user-id without any user consent. Has the user previously used your app, you will also be able to get their accesstoken and fetch more info about them.
It requires some backend code to decode the signed request parameter, which provides you this stuff.
This example is how php handles signed request:
https://developers.facebook.com/docs/facebook-login/using-login-with-games/
If you're using C#, download the Facebook C# (available through NuGet, the package from Outercurve Foundation) and use this example:
How do I parse a signed request in Facebook C# SDK?
I try to handle the user in Facebook context whenever possible. It adds trust and more tools. Although since the Facebook phone/tablet app (App Store/Google Play) doesn't support Facebook apps at all, I often optimize the app for mobile web use also. I read somewhere that over 50% of daily Facebook visists are done using the phone app, so it might be something to think into your app while developing.
UPDATE:
I can see I have misunderstood part of signed request, as commented by Shadowfax and CBroe. In my app, I use the user id from signed request but of course only when the user has already logged on to the app beforehand. My apologies.

Google+ sharing post on specific friend's stream in ios

Is there any url or technique available in google+ in order to share posts on the one specific friend's stream?
I found this url: https://plus.google.com/share?url={your url}
but the problem with this url is that we can't pass the friends id or name of the friend in parameter of the url in order to get the prefilled friends name written on that field (where we mention with whom we want to share the post) when the link is opened in the browser.
When I am using the above found url, I have to select the name of the friend manually on the browser after the link has been opened. I want to prefil that field in which we write the name of the friend with whom we want to share.
Can any one please help me out. It is one of my requirement. I am developing application in xcode
Google+ does not allow for programmatic writing to anyone's stream. Users in Google+ always retain control over what to share and who to share it to. You can use the Google+ SDK for iOS to prompt users to share, but they have ultimate control to choose who to share to.
For native iOS there is no way to prefill the recipients. You can on Android and via the Javascript share rendering on the web, but not using the iOS SDK. It's definitely worth requesting the feature on the issue tracker if it's something you're interested in though! https://code.google.com/p/google-plus-platform/issues/list

Post to wall on Facebook: How to recognize Mobile / Desktop users?

When my app posts an image on the wall on Facebook, there is also a link posted that leads to the facebook app.
If the post is seen on a desktop, I want the link to redirect them to the flash based facebook app.
If the post is seen on IOS, I want them instead to see the download link of the same app on the App Store.
Is that possible? Any suggestions?
Trying to change the Facebook link that would either redirect to one page or the other isn't a good practice (and that even wouldn't be possible). Just let the user click on the same link wherever he is using Facebook.
So, once the user on your web page, just catch the user agent which will give you information about his browser and device or computer. Depending on this, you'll know whether he is on a desktop or mobile phone. You'll then be able to redirect the user with the appropriate URL redirection. I let you search on this side with some help:
How do I determine whether it's a mobile device with PHP?
Mobile_Detect is a lightweight PHP class for detecting mobile devices. It uses the user-agent string combined with specific HTTP headers to detect the mobile environment.
For example: what is your User Agent?
Detect Mobile Browsers | Open source mobile phone detection
"know if mobile browser" on Google