Do google ads for double click (dfp) can be displayed on ionic just like on the website
Yes you can display it but need some kind of modification the way it has been used in plugins.
Go with angular way insted of plugin way
can you help me with that ? i can’t figure it out
Yes What kind of help you need in this, what are you not being able to figure out
i want to display dfp ads on my ionic1 ( or any ionic version) app but don’t know how . I’ve looked for it on internet but cannot find any example .
i created add unit then generated ‘Google Publisher Tag’ and it gave me codes . i copy and pasted it into my index.html file . i created order but it doesn’t show the add i don’t know how . Can you please help me with that ? i have to finish it before monday
define the usel to extract an add from google as
var myUrl =“http://pubads.g.doubleclick.net/gampad/adx?iu=” + iu + “&sz=” + size + “&c=” + cnt
Execute Ajax Get Request
The response will be add content to be displayed in you page
Create an HTML section and bind this content to that section
<head>
<script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'></script>
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
</script>
<script>
googletag.cmd.push(function() {
googletag.defineSlot('/4740886/newAdd_320x50', [320, 50], 'div-gpt-ad-1534158600127-0').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
</head>
<body>
<div id='div-gpt-ad-1534158600127-0' style='height:50px; width:320px;'>
<script>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1534158600127-0'); });
</script>
</div>
</body>
this is genrated tag from my dfp ad . I really don’t know how to get URL from this . ‘size’ and ‘cnt’ is okay , i get them but don’t know about ‘iu’
let iu = ‘4740886’;
var myUrl =“http://pubads.g.doubleclick.net/gampad/adx?iu=” + iu + “&sz=” + size + “&c=” + cnt
so myUrl should be like “4740886&sz=320x50&c=1” right?
Where do i must call myUrl then?
And do i still need this generated tags in ?
Yes now make an ajx call to this URL and plot the reply in some div where you want to display your DFP add
my AJAX GET request
$http({
method: 'GET',
url: '/4740886&sz=320x50&c=1'
}).then(function successCallback(response) {
$scope.resp = response;
}, function errorCallback(response) {
console.log(response);
});
gives this error :
data: "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot GET /4740886&sz=320x50&c=1</pre>\n</body>\n</html>\n"
status: 404
statusText: “Not Found”
The Information you shared above is great. I have been reading all you shared here. In this you explained everything very well. If i want any further guideline we will contact you here https://forum.ionicframework.com/t/google-dfp-doubleclick-for-publisher/101615/13.