Facebook Audience Network - Get Ad Placement Id - android

I'm implementing the Facebook Audience Network SDK across iOS and Android. I set certain flags by checking a dictionary for the existence of an Ad, by looking up the Ads placementId. On iOS you can access this via the delegate methods easily, as below:
- (void)adView:(FBAdView *)adView didFailWithError:(NSError *)error
{
NSLog(#"Adview placement id is: %#", adView.placementId);
}
However on Android, the Ad object (in the Ad's listener) doesn't seem to have a placementId property as it's encapsulated. So this is either the usual inconsistencies between third-party SDK's cross platform, or i'm missing something?
Is it possible to retrieve the Ads placement id directly from the Ad object on Android, as you can do on iOS?
(Note: Facebook's docs don't seem to mention it)

Have you checked the AdView object in the Android implementation? it contains the placementId as well.

Related

Where do I find my facebook ad's placement ID?

I'm trying to fill the impression gap of my other ad provider with Facebook ads (Facebook audience network) to increase the income of my application.
So far so good, the testing works, I see the facebook test ad on the emulator, however, when it comes to this code:
fbRewardedVideoAd = new RewardedVideoAd(ctx, "YOUR_PLACEMENT_ID");
I simply stuck. Documentation says it is okay for testing but I should replace this with my real placement id which I absolutely cannot find no matter where I'm looking for it and the documentation also fails to state where should I look for it.
So where is this placement id? What is this at all?
Anyone can help?
You can find your placement ID under Monetisation Manager-Properties-Your application. (if you have already created the placement ids)
If you have not created you can create a property first(Link your application) and under it you can create ad space and then property ids.
The document is here - Facebook Business

Hot to integrate Meta(Facebook) Audience Network binding with Admob?

Based on my understanding those are the required steps to integrated binding Audience Network:
Completed the Audience Network Setup
Integrating Facebook Audience Network with Mediation
Add a Network Security Configuration File
I am implementing native ads, and there is one extra step for it that I don't understand
The docs says:
Some Facebook native ad assets don't map one to one to Google native
ad assets. Such assets are passed back to the publisher in a bundle in
getExtras() method in NativeAd. Here's a code example showing how to
extract these assets:
Bundle extras = nativeAd.getExtras();
if (extras.containsKey(FacebookAdapter.KEY_SOCIAL_CONTEXT_ASSET)) {
String socialContext = extras.get(FacebookAdapter.KEY_SOCIAL_CONTEXT_ASSET);
...
}
What am I supposed to do with the socialContext? Also, it's an object and not a string.
At moment, I am getting Admobs ads, but for Meta, I am able to make binding requests and have some fill rate, but there are no impressions. All the rest is green.
In the Publisher Onboarding Debugger it shows that I don't properly integrate the impressions.

Querying active directory to get attribute on android

Hi (i'm new to this so you'll need to forgive me)
My end goal is to be able to grab an attribute from Microsoft azure active directory for use in my app. The issue being that while i have done a fair amount of research i'm still at a loss of how to achieve my end result.
I have found that Microsoft has an API of sorts that allows authentication with azure AD but i'm unable to find any information as to how i query an attribute.
Possible solutions I've looked into:
https://learn.microsoft.com/en-us/azure/active-directory/develop/active-directory-devquickstarts-android (Microsoft's android AD API)
Using Java to find simple Active Directory Information (this isn't a possible solution as i need azure integration as the AD server isn't outward facing).
I'm sure that the solution to this isn't a complex one but i would be grateful if someone could point me in the right direction. I don't have much experience with AD which is why i'm struggling here.
You could learn how to integrate Azure AD into an Android app from here . You could call Microsoft Graph API or Azure AD Graph API to access AAD resource :
To call Microsoft Graph API/Azure AD Graph API from Android Native Client application , In Settings blade of that app in azure portal, select Required Permissions and select Add. Locate and select Windows Azure Active Directory(Azure AD graph api )/Microsoft Graph(microsoft graph api) , add the appropriate permissions under Delegated Permissions .
To get access token With ADAL for android :
mContext.acquireToken(MainActivity.this, resource, clientId, redirect, user_loginhint, PromptBehavior.Auto, "", callback);
resource is required and is the resource you're trying to access.So you need to set that value to "https://graph.windows.net" if you want to call Azure AD graph api , and "https://graph.microsoft.com" if you want to call Microsoft Graph Api.

How to track organic vs paid-ad facebook users in my app?

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!

How to use AdWhirl with an unsupported ad company?

Does anyone know how AdWhirl works?
I set up my custom event for Greystripe in which I initialize the SDK if it wasn't already initialized, and refresh the BannerView, but I don't see the custom event getting called. So my main question is, how and when does AdWhirl call the custom event? What are the rations and rollovers? I haven't done anything with them (mainly because I don't know why I need them. What does AdWhirl do with them?)
Also, how do I control when AdWhirl refreshes my banner? I'd like to tie the refresh with a button action.
I've been searching online nonstop for the past two days and read a lot of tutorials and example Java classes that people have shared, but none of them have worked. It just looks like AdWhirl is stagnate. It's so unclear to me how AdWhirl works beyond: it mediates between the app and all the ad opportunities you want to use in your ad. That's an entirely too high-level understanding for me to move forward. :(
Have you read the wiki page that describes how to use Custom Events? You basically create a custom event in the backend UI which behaves like another ad network, and you can configure it's traffic. Then you can implement the function name that you named in the backend. The only unintuitive part is that you have to implement AdWhirlInterface to listen for the custom event, which means creating an adWhirlGeneric() method. This method can be empty though, I am not seeing it called when creating my own test event. Finally, make sure to set the AdWhirlInterface.
So assuming on the backend you created a network with:
Name: Test Network
Function Name: testEvent
and gave it traffic (I recommend giving it 100% traffic when testing), then your code would look something like this:
public class MyActivity extends Activity {
...
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
...
}
...
public void testEvent() {
// Place event code here.
Log.d("Cust_Network", "Cust network got called!");
}
}
To control refreshing your ad, call rotateThreadedNow() on the AdWhirlLayout when a button is clicked, for example. This will take AdWhirl through the process of randomly determining a new ad network, and calling the correct adapter, or custom event in this case. If you choose to go this route, you may not want automatic refreshing, in which case you should disable automatic refreshing on the back end.
The ration object is populated with data from the configuration data. Each ration represents an ad network, and has keys which represent the individual ad network ids, weight percentages that you set in the backend, and backfill priority. Backfill priority is the network order that AdWhirl will request from if the original request did not fill. This process of going through backfill priority is called rollover. You will need to know a little bit about rollover when implementing your own custom event.
The wiki page mentioned has these recommendations to add to your custom event:
// In your custom event code, you'll want to call some of the below methods.
//
// On success:
// this.adWhirlLayout.adWhirlManager.resetRollover();
// this.adWhirlLayout.rotateThreadedDelayed();
//
// On failure:
// this.adWhirlLayout.rolloverThreaded();
If your custom event properly fetches an ad, you will want to reset the rollover order (so the next request will have the correct backfill order), and call rotateThreadedDelayed() so that a refresh will happen automatically in the amount of time you specified on the back end. If the ad request failed, you will want to call rolloverThreaded() so that AdWhirl can go through it's rollover process to check your other configured ad networks for ads.
if you want you can use an open source library i've developed that allows to use AdWhirl with other (unsupported) ad networks (but also with the officially supported ones). This library is also extensible, so you can add a new network to it and manage easily through AdWhirl.
The library is AdMAL (Ad Mediation Abstraction Layer) and is available on a github.com repository under the Apache 2.0 open source license: https://github.com/marcosiino/AdMAL
Using AdMAL you can easily implement AdWhirl in your applications for both supported and unsupported network (the integration is easiest than implementing AdWhirl SDK). Actually it only supports iOS (it's developed in Objective-C), but i plan to port to android in the next months.
I started AdMAL for my own purposes, then decided to release it to the public under an open source license some days ago. Hope this help! I encourage other developers to improve the library and implement new networks support, so that this can benefit to everyone.

Categories

Resources