User Tools

Site Tools


proton:admanager_flurry

This is an old revision of the document!


Flurry

Flurry is implemented as a plugin to the AdManager. You init it with your apps Flurry ID, then you can make calls to track specific pages, which will later show up in the Flurry dev console.

Currently supported on Android only.

Adding Flurry to the AdManager

  • Add /shared/Ad/AdProviderFlurry.cpp to your project

Add the following under your other #include's near the top of App.cpp:

#ifdef RT_FLURRY_ENABLED
#include "Ad/AdProviderFlurry.h"
#endif

Note, the #ifdefs I use are not really required here, but it's useful so you can turn on/off different ad systems easily for specific builds or platforms.

Next, add the following code under the existing m_adManager.Init() statement. (You did already setup AdManager, right?!)

#ifdef RT_FLURRY_ENABLED

	AdProviderFlurry *pFlurryProvider = new AdProviderFlurry;
	pFlurryProvider->SetupInfo("<your flurry API key>");
	m_adManager.AddProvider(pFlurryProvider);
#endif

Note:  You'll need to replace the <your flurry api key> part with the stuff you cut and paste from the Flurry control panel.

In your App.h, add the following somewhere so Flurry will actually be used. (You can still compile with it under Windows builds for testing, it just won't do much)

#define RT_FLURRY_ENABLED

Tracking stuff. To actually track data with Flurry, you do it this way:

//on your about menu, you could add this to see how many people actually look at it:
GetApp()->GetAdManager()->TrackingLog("AboutMenu");

//when someone buys IAP, you could add this to track what people are buying:
GetApp()->GetAdManager()->TrackingLog("BoughtIAP", "powerBoots", "$1.99"); //limited to two "extra" parms, besides the main page name

Enabling Flurry for Windows Android build

These directions assume you are using the proton v2 android build system, which nearly all examples use now. You can look at RTAdManager for an example if needed.

First, download the Flurry SDK for Android (you'll need a Flurry account to see that option) and place FlurryAgent.jar in the \shared\android\optional_src\libs\Flurry, which should exist already. I can't include this file in p+ for legal reasons.

* Add -DRT_FLURRY_ENABLED to the SHARED_FLAGS variable in your /android/jni/Android.mk file, in case it isn't defined in your App.h
* Make sure shared/Managers/AdManager.cpp, shared/Ad/AdProvider.cpp, and shared/Ad/AdProviderFlurry.cpp are added to your /android/jni/Android.mk file

In your build_prepare.bat, you should see this somewhere already:

:for Flurry  (comment out the goto if you want to use it)
goto skipflurry;
set TEMPFILE=..\..\shared\android\optional_src\libs\Flurry\FlurryAgent.jar

:Extra check to make sure we can locate the files
if exist "%TEMPFILE%" (
echo Located flurry files.
) else (
echo Cannot find FlurryAgent.jar.  Download and place lib into shared\android\optional_src\libs\Flurry
..\..\shared\win\utils\beeper.exe /p
)
copy %TEMPFILE% libs
:skipflurry

Change “:goto skipflurry;” to “goto skipflurry;”, this will cause the flurry jar file to get copied to libs during the build process.

Next, edit your android/src/Main.java and change

// #define RT_FLURRY_SUPPORT

to

//#define RT_FLURRY_SUPPORT

to enable it.

The android/AndroidManifest.xml doesn't require any special changes or privileges.

That's it, Flurry should work in your Android build now.

proton/admanager_flurry.1342480880.txt.gz · Last modified: 2012/07/16 23:21 by seth