2

I've been requested to add analytics stuff on a app that I'm working on, and one of the events that I need to track is: in what screen of the app the user was when he touched an AD.

That seems strange to me, and I think its not possible to do it on a reliable way. I tried looking online but with no luck.

We are using multiple ad networks, so I thought of adding some event that tracks when the user leaves the app (ads usually do that).

Anyone know a better way to do that, or even, if is it possible to do that with any ad network?

Thank you.

paulonogueira
  • 2,684
  • 2
  • 18
  • 31

4 Answers4

1

I will speak for IOS but i am sure that it is possible in android as well. On IOS, check if the advertisement framework has any delegate methods, any popular one should. If you are rolling your own, simply add your own delegate methods to the framework. For example, iAds has the following delegate method:

- (BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner willLeaveApplication:(BOOL)willLeave

This method is called when a user clicks on an advertisement. I assume you know how to track which view an application is in, using viewDidAppear and saving the currently last loaded page somewhere to access later. You can then submit that page name to your analytics inside of the above delegate method, or whichever framework you are using delegate method.

Kris Gellci
  • 9,539
  • 6
  • 40
  • 47
1

on the event of when the app goes in background, after an ad click event [set a global boolean when the ad is clicked]

inside the the method which gets called when the application goes into background:

if(the global boolean is set)

and when the app resumes, reset the global boolean.

Community
  • 1
  • 1
Vinay W
  • 9,912
  • 8
  • 41
  • 47
  • This will log as though a user has clicked on an advertisement even when a user just exits the application and is not a good idea of the analytics use is to see what page is receiving the ad clicks, not what page the user exits the application. – Kris Gellci Dec 08 '12 at 20:55
  • that could work, but my main problem is that I have no idea on how to set the global variable to true. I mean, does the ad framework tells me when its activated? – paulonogueira Dec 09 '12 at 22:01
1

Why not just make evey different view a different site, ie give the ads in each view a different id. It is a little bit of a pain to set this up if you have several applications/or lots of views, but I think that it should work.

jcw
  • 5,132
  • 7
  • 45
  • 54
0

It's pretty simple if you look at it from another view. Make 2 different ads and each one on a different screen. Then look at the analytics on each one. Can you tell me what you're using, C# or flash? In flash there's a function that executes when the user leaves the app.

Flash:

NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE , handleDeactivate, false, 0, true);

 function handleDeactivate(event:Event):void {
     //the app is now losing focus
 }

 NativeApplication.nativeApplication.addEventListener(Event.ACTIVATE, handleActivate, false, 0, true);

 function handleActivate(event:Event):void {
    //app is starting
 }

there is another way i remember but not coming to me at the time.