9

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>
alexp
  • 3,587
  • 3
  • 29
  • 35
  • +1 for the link to "Serve ads in a non-JavaScript environment". It would have been nice for google to include that link in the "Serve creatives in an email or newsletter" article. – sleep Nov 07 '12 at 03:38
  • The link in your first line is no longer available - do you have an updated URL (was it [Serving creatives in an email or newsletter](https://support.google.com/dfp_premium/answer/1258792?hl=en)? – Stephen Lead Jul 30 '14 at 00:03
  • 1
    @slead I don't have an updated link. It's been a long time, but I think the original article I linked to was longer and more involved than the link you posted. – alexp Aug 04 '14 at 18:38

4 Answers4

11

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.

scoopseven
  • 1,767
  • 3
  • 18
  • 27
  • I haven't verified this, but according to the docs it should work. I don't think this was around when I asked the original question. Marking as accepted since it looks like this is the best option. – alexp Jan 25 '15 at 20:54
  • @scoopseven so do you cut 3rd party tags entirely or what is the solution there? – straykiwi Apr 07 '15 at 21:30
  • 2
    We serve 3rd party tags on the site only. For email newsletters we require image and clickthru href's only. – scoopseven Apr 08 '15 at 04:34
  • Does the clickthrough work in email clients that don't support cookies such as Outlook with a default browser that isn't IE, such as chrome or firefox? – straykiwi Apr 09 '15 at 03:26
  • 1
    I haven't tested those specific scenarios but the co option essentially turns off cookies, so DFP isn't depending on them. So there's no reason it wouldn't work in those environments. – scoopseven Apr 09 '15 at 13:59
  • I've created test code that generate random links. With co=1 it works fine. See code details in http://rextester.com/TBAKX36405 – Michael Freidgeim Feb 08 '16 at 00:51
7

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>
asPagurus
  • 3
  • 2
besimple
  • 444
  • 1
  • 7
  • 12
  • This looks interesting, thanks for sharing. Did you notice if this cause double impression counts? It seems like that might be a risk, but since the cbuster is identical it should not double count. I'm thinking I might introduce a slight delay to ensure the image loads first, or better yet wait for the image load via javascript before redirecting to the target. – Julian Jun 19 '13 at 20:47
  • I'm sorry to say this does not appear to work in my testing. DFP may pull a different ad for the webserver-based request, resulting in a different click-through target. Sadness. – Julian Jun 20 '13 at 16:43
  • To Julian: I tested this script and at least so far I get realistic number of impressions. How did you set your campaign? I usually use Sponsorship and have only one ad to ensure that the ad is always shown. – besimple Jul 28 '13 at 21:05
  • Right, if it's always the same ad being delivered, it should be OK, but if ads are rotated in a normal way, there is no connection between the ad the user sees initially and the one loaded by the website once they click through. – Julian Aug 22 '13 at 23:36
  • @besimple thanks very much for posting this. I'm finding that it works most of the time, for most users - but sometimes freezes without redirecting to the DfP URL. It may be related to ad-blockers? Is `meta HTTP-EQUIV="REFRESH"` still valid on all browsers? – Stephen Lead Aug 22 '14 at 00:13
  • I think I've narrowed the problem down to users running AdBlock, which prevents the redirect. [This page](http://thepcspy.com/read/how_to_block_adblock/) gave tips on detecting AdBlock, in which case I display a message to the user. – Stephen Lead Aug 24 '14 at 23:54
  • 1
    So I have encountered this issue, the redirect responds with the dreaded 204 response, UNLESS the image is sized appropriately. In my case 728x90. Any other size and Google returns the 204, but inconsistently. Sometimes it works and it varies from browser to browser. Also it looks like Chrome is STRICT when it comes to meta refresh. Tjis is what worked on Chrome in PC (worked regardless on Mac) – roberthuttinger Jun 10 '15 at 19:38
5

It turns out that DFP for small business requires cookie support to work, even when using the non-JavaScript method of calling ads. So it works fine in web-based clients like Gmail, but it doesn't work in Outlook and the like. DFP Premium can supposedly serve ads in email without requiring cookies.

alexp
  • 3,587
  • 3
  • 29
  • 35
3

Using the co= option doesn't work for DFP Small Business. My workaround is:

Use the same code for img <img src="https://pubads.g.doubleclick.net/gampad/ad?iu=/{my_pub_id}/300x250_email&sz=300x250&c={cachebuster}" />

And build a redirect link on your website <a href="http://yourwebsite.com/adunit/300x250_email">. This page reads and filters the response from http://pubads.g.doubleclick.net/gampad/adx?iu=/{my_pub_id}/300x250_email&sz=300x250&c={cachebuster} in order to get the click-tracking link using javascript link=$(xmlDoc).find('a').attr('href'); and redirect.

This workaround doesn't work for rotation (more than one creative/line item is competing for the same ad unit at the same time).

I'd like to know how to serve email ads in rotation using DFP SB

Levon
  • 91
  • 1
  • 5