App Events with Click Tracking in iOS

76 views
Skip to first unread message

cosmin...@fortech.ro

unread,
Oct 11, 2013, 4:55:40 AM10/11/13
to google-adm...@googlegroups.com
Hi,

We have difficulties in implementing in App Events and also track clicks.We are using in App Events because we need some some parameters in the app (check out   "ad_origin_key=&k_key=&acid_key=&ad_image_url_key=" in the source code below). 

So my question is this: how can we implement in App Events and also track clicks without having the AdMob SDK present the ViewController  from the SDK. ?

We approached this by using an iFRAME to open the click tracking URL. The problem is that when we create the IFRAME and open the Click tracking URL the AdMob SDK presents a ViewController to display a Web View containing the URL from the IFRAME. Basically any HTTP request that we would make it would be intercepted in some way by the delegate of the UIWebView that displays the AD and then present the ViewController from the SDK.


This is the HTML code :

<html>
<head>
<script src="http://media.admob.com/api/v1/google_mobile_app_ads.js"></script>
<script>
function makeFrame(url) { 
   ifrm = document.createElement("IFRAME"); 
   ifrm.setAttribute("src", url); 
   ifrm.style.width = "0"; 
   ifrm.style.height = "0";
   ifrm.style.display = "none";
   ifrm.onload = function () {
this.parentNode.removeChild(this);
   }
   document.body.appendChild(ifrm); 

    
function fireEvent() {
makeFrame("http://adclick.g.doubleclick.net/aclk?sa=L&ai=B4V13NQZVUuOYNq_V0AHtx4GAA8Su8IgEAAAAEAEgzIiKIDgAWOSio7VqYIP94YWIHLIBQzEyLmlwaG9uZS5jb20ubXl3ZWJncm9jZXIuc2hvcHJpdGVjaXJjdWxhci5hZHNlbnNlZm9ybW9iaWxlYXBwcy5jb226AQlnZnBfaW1hZ2XIAQnaAUtodHRwOi8vMTIuaXBob25lLmNvbS5teXdlYmdyb2Nlci5zaG9wcml0ZWNpcmN1bGFyLmFkc2Vuc2Vmb3Jtb2JpbGVhcHBzLmNvbS_AAgLgAgDqAigvNDY0NC9TaG9wcml0ZV9pT1NNb2JpbGVfUGxhbm5pbmdfMzIweDUw-AKD0h6QA4QHmAPgA6gDAdAEkE7gBAGgBh8&num=0&sig=AOD64_2URnqZe-FVAn76nYwPGojs4vVsLA&client=ca-pub-4820512047646569&adurl=");
admob.events.dispatchAppEvent("query_string", "ad_origin_key=&k_key=&acid_key=&ad_image_url_key=");
    }
</script>
</head>
<body>
<img src="http://pagead2.googlesyndication.com/pagead/imgad?id=CICAgMCuoMGqyAEQARgBMgjK35pOcsifww" width="320" height="50" border="0" onclick="fireEvent();"/>
</body>
</html>

Is there any other way to implement in App Events and Click tracking without having the SDK View Controller presented?

Thank you! 

Eric Leichtenschlag

unread,
Oct 14, 2013, 10:27:47 PM10/14/13
to google-adm...@googlegroups.com
It sounds like the app events piece is working fine and isn't the issue.

As far as click tracking, have you tried using an XMLHttpRequest instead of adding an iFrame element?

Thanks,
Eric

Gerson

unread,
Dec 19, 2013, 7:42:22 AM12/19/13
to google-adm...@googlegroups.com
Hi,
We are trying to solve the exact same issue.
Were you successful?
Thanks.
Reply all
Reply to author
Forward
0 new messages