Help Center/Details/

Admob Custom Event for CSJ

Please set Admob in your app first.

Setup CSJ Platform

Create a CSJ account

Create an application and placements in CSJ

  • Click Apps -> + Add App to create a app for mediation.

create-app-home.png

create-app.png

  • You will get an app with its app ID.


    app-id.png

Create Ad Placement

  • Click Ad Placements -> + Add Ad Placement to create the placement for mediation.


    create-placement.png

  • Select the ad's type for your app and finish the create.


    ad-type.png

  • You will get a placement with its placement ID.


    placement-id.png

Add CSJ to AdMob's mediation

Create mediation

  • Click Mediation -> CREATE MEDIATION GROUP to create a mediation group.


    add-mediation.png

  • Select the same ad format which created on CSJ side.


    ad-format.png

  • After select the ad unit you created on AdMob which you want to embed mediation, click ADD CUSTOM EVENT to set with CSJ.


    add-custom-event.png

  • Add adapter's class name to Class Name.

    • Class Name: the adapter class's name , for example,BUDAdmob_RewardCustomEventAdapter
  • Add {"placementID":"your slot ID"} to Parameter.

mediation-param - ios.png

  • Please make sure to use JSON to set Parameter. Or you need to customize adapter yourself.

Class name for different ad formats

Ad Type Class Name
Reward Video Ads BUDAdmob_RewardCustomEventAdapter
Interstitial(Fullscreen Video) Ads BUDAdmob_FullScreenVideoCustomEventAdapter
Banner Ads BUDAdmob_BannerCustomEventAdapter
Native Ads BUDAdmob_NativeFeedCustomEventAdapter

Initialize CSJ SDK and Adapter

Import and Init CSJ SDK

Add the information as follows in Podfile, and using pod update or pod install to intergrate.

pod 'Ads-Global' :subspecs => ['Domestic']

Initialize CSJ with the APP ID as the argument. Unless there is a particular reason, stipulate asUIApplicationDelegate application(_:didFinishLaunchingWithOptions:)

We recommand to use asynchronize initialization method + (void)startWithAsyncCompletionHandler:(BUCompletionHandler)completionHandler; to init the SDK, and also set allowModifyAudioSessionSetting to true to not interrupt the background's audio playback.

Note:You must set territory to CN manually

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

    let configuration = BUAdSDKConfiguration()
        
    #if DEBUG
    // enable log print. default is none.
    configuration.logLevel = .debug
    #endif
    //Set territory to CN manually is required.
    configuration.territory = BUAdSDKTerritory_CN;
    
    configuration.appID = "Your_App_Id"
        
    //Set to true to NOT interrupt background app's audio playback
    configuration.allowModifyAudioSessionSetting = true
        
    BUAdSDKManager.start(asyncCompletionHandler:) { (success, error) in
        if ((error) != nil) {
            //init failed
        }
    };

    return true
}

Embed CSJ Adapters

CocoaPods (preferred)

From our adapter v1.4.1, we support CocoaPods integration, and this is the prerequisite for using it.

  • CSJ SDK 3.7.0.0 or higher
  • Google-Mobile-Ads-SDK 8.0.0 or higher

Add the information as follows in Podfile, and using pod update or pod install to intergrate.

pod 'Pangle-adapter-for-admob'

About Swift

  • If your project is based on Swift, please add adapter's header file into your bridge-header file.


    bridge-header.png

Demo

  • You can find simple use cases from Demo.
Did the content solve your problem?
Contact us