AdSemse for Games(AFG) Access Guide

Please provide the product information to MG staff, that we will create exclusive channel ID

Please embed MG SDK of the corresponding version with your product, under the guide of MG staff. During which process, the previously created channel ID will be used.

First access MG SDK

The Browse Ads sample code is as follows:


public async void ShowUniversalGoogleBrowse()
{
	var command = new UniversalGoogleAdCommand
	{
		ChannelId = UniversalGoogleChannelId,//Google Channel ID  
		AdType = UniversalGoogleAdType.Browse,//Ad Type
		Tag = "browse_tag"//Ad Tag
	};
	var gad = await AdvertisingManager.ShowUniversalGoogleAdAsync(command);
	if(gad.ReturnValue)
	{
		// The callback after the Google ad played 
	}
}


Platform::String^ MainPage::ShowUniversalGoogleBrowse()
{
	auto opt = ref new MiracleGames::Models::UniversalGoogleAdCommand();
	opt->ChannelId = "GoogleChannelId";//Google Channel ID
	opt->AdType = MiracleGames::Models::UniversalGoogleAdType::Browse;//Ad Type
	auto initTask = Concurrency::create_task(MiracleGames::AdvertisingManager::ShowUniversalGoogleAdAsync(opt));
	initTask.then([](MiracleGames::Services::Core::Common::AsyncProcessResult^ result)
	{
		if (result->ReturnValue)
		{
			//The callback after the Google ad played 
		}

	});
}

The Reward Ads sample code is as follows


public async void ShowUniversalGoogleBrowse()
{
	var command = new UniversalGoogleAdCommand
	{
		ChannelId = UniversalGoogleChannelId,//Google Channel ID
		AdType = UniversalGoogleAdType.Reward,//Ad Type
		Tag = "reward_tag"//Ad Tag
	};
	await AdvertisingManager.ShowUniversalGoogleAdAsync(command);

}
//Sign up for a reward AD return to receive method
AdvertisingManager.UniversalGoogleAdEvent += (o, args) =>
{
	if(args.Param== "reward_tag"&& args.Method == MethodType.AdViewed)
	{
		Debug.WriteLine("Reward AD viewing completed");
	}
	Debug.WriteLine($"Universal ad events fired, method {args.Method}, param {args.Param}");
};

Platform::String^ MainPage::ShowUniversalGoogleBrowse()
{
	auto opt = ref new MiracleGames::Models::UniversalGoogleAdCommand();
	opt->ChannelId = "5601598939";//Google Channel ID
	opt->AdType = MiracleGames::Models::UniversalGoogleAdType::Reward;//Ad Type
	opt->Tag = "reward_tag";//Ad Tag
	MiracleGames::AdvertisingManager::ShowUniversalGoogleAdAsync(opt));
	return "";
}
//Sign up for a reward AD return to receive method
Loaded += ref new RoutedEventHandler([this](Object^, RoutedEventArgs^)
{
	MiracleGames::AdvertisingManager::UniversalGoogleAdEvent += ref new EventHandler(
		[&](Object^o, MiracleGames::Models::UniversalGoogleAdEventArgs^ args)
	{
			if (args->Param == "reward_tag"&& args->Method == MiracleGames::Models::MethodType::AdViewed)
			{
				 // "Reward AD viewing completed"
			}

	});
});

To check the advertising performance, please contact MG staff to extract data from the AFG backend.

Overall Data

Detail Data

Click the "View Report" icon next to the custom channel you want to query in the table

Detailed data of chosen channel is shown here