3

I'm about to create my first HTML5 ad and to upload it to my AdWords campaign. Any chance I can somehow get AdID of the device that reuqests my HTML5 ad? I wonder if I can achieve it with my ad's Javascript code.

benams
  • 4,308
  • 9
  • 32
  • 74

2 Answers2

3

Maybe you can skip doing it in the ad itself, and add a value track parameter to your tracking template? e.g. {lpurl}?adid={criteria}

https://support.google.com/adwords/answer/2375447?co=ADWORDS.IsAWNCustomer%3Dfalse&hl=en#

Ethan
  • 173
  • 12
  • Nice approach, but it's not enough for my goal. I'd like to retrieve the AdID even if the ad is not clicked. – benams Apr 20 '18 at 08:58
  • Gotcha. So you essentially want to track the impressions as well as clicks. I'll try to come back to this one when I have a little more time. – Ethan Apr 20 '18 at 16:13
  • True. Thanks for the help! – benams Apr 20 '18 at 16:42
0
<script type="text/javascript"> 
    function trackConv(google_conversion_id, google_conversion_label) {
        var image = new Image(1, 1); 
        image.src = "//www.googleadservices.com/pagead/conversion/" + google_conversion_id + "/?label=" + google_conversion_label + "&script=0";  
    }
 </script>

 <a onclick="trackConv(1234567890, 'LQV8CNq6RxCKlPbvAw');" href="http://www.example.com">Link</a> 
Vikas Gautam
  • 997
  • 7
  • 23
  • where did you get those parameters values and SRC value from? (1234567890, 'LQV8CNq6RxCKlPbvAw'); image.src = "//www.googleadservices.com/pagead/conversion/" + google_conversion_id + "/?label=" + google_conversion_label + "&script=0"; In addition, seems like the user has to CLICK the add in order to make it happen, while I want to know AdID even if a user just sees an ad and decides not to click it. – benams Apr 23 '18 at 14:00
  • Also, I get an error when I try to reference an external image with my JS: "first_ad.zip - Your HTML5 ad is trying to reference an asset that is external to your .ZIP file: //cdn-cms.f-static.com/uploads/778661/400_5a15390a5aa54.jpg. Only internal file references are allowed (for example, "path/to/asset/in-zip.png"). Make sure you have included all of your assets in the .ZIP file and that all file references are internal. Once you have made the changes, try again" – benams Apr 23 '18 at 14:33