Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google DFP ads in email behaving strangely

I am trying out serving DFP ads in email. I'm following the guidelines here.

  • I have an ad unit set up just for email
  • I have a line item targeting that ad unit with just an image creative
  • The line item doesn't have any targeting restrictions or anything like that

The ad will show up in the email, at least the first time. The strange thing that I'm seeing is, after the first click, clicking on the ad again will often bring me to a blank page rather than the click-through page of the creative. Also, when I reopen the message, occasionally the image will not load. The code in the email looks like this:

<a href="https://pubads.g.doubleclick.net/gampad/jump?iu=/{my_pub_id}/300x250_email&amp;sz=300x250&amp;c={cachebuster}&amp;tile=1">
<img src="https://pubads.g.doubleclick.net/gampad/ad?iu=/{my_pub_id}/300x250_email&amp;sz=300x250&amp;c={cachebuster}&amp;tile=1" />
</a>
like image 482
alexp Avatar asked Oct 02 '12 20:10

alexp


2 Answers

We've solved this by turning off cookies in the standard tag using the co= option; adding co=1 to the tag.

<a href="https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/{my_pub_id}/300x250_email&amp;sz=300x250&amp;c={cachebuster}&amp;tile=1">
<img src="https://pubads.g.doubleclick.net/gampad/ad?co=1&iu=/{my_pub_id}/300x250_email&amp;sz=300x250&amp;c={cachebuster}&amp;tile=1" />
</a>

The only problem (for us) that this creates is that we're unable to serve 3rd party tags, even ones that resolve directly to .gifs, using the standard tag.

like image 117
scoopseven Avatar answered Oct 15 '22 13:10

scoopseven


Had the same problem and I solved it by using script to redirect click via script on my web server where ad is shown again so that all the cookies can be set.

Link looks like this: http://www.mysite.com/dfpclick.php?adunit=mailing&cbuster=1369608725

Script dfpclick.php:
<?php
/* Google DFP url redirect*/
if ($_REQUEST['adunit']) {
    $sUrl = 'http://pubads.g.doubleclick.net/gampad/jump?iu=/%mygoogleid%/'.$_REQUEST['adunit'].'&sz=1x1&c='.$_REQUEST['cbuster'];
}
?>
<html>
<head>
<meta HTTP-EQUIV="REFRESH" content="0; url=<?=$sUrl?>">
</head>
<body>
<?php
if ($_REQUEST['adunit']) {
    echo '<img src="http://pubads.g.doubleclick.net/gampad/ad?iu=/%mygoogleid%/'.$_REQUEST['adunit'].'&sz=1x1&c='.$_REQUEST['cbuster'].'" width="0" height="0" border="0" style="width:0px; height:0px;" alt=""/>';

}

?>
</body>
</html>
like image 39
besimple Avatar answered Oct 15 '22 11:10

besimple