javascriptphpdouble-click-advertising

How to retrieve IDFA/AdID for use in dc_rdid attribute using PHP or JS?


I'm trying to publish a client's ad to our site (an "HTML5 ad" presented in an iFrame; we are hosting the HTML). The ad instructions indicate:

The publisher needs to insert device IDs into dc_rdid to enable in-app conversion tracking.

The value assigned to the dc_rdid attribute is supposed to be the "IDFA" on iOS and the AdID on Android (and no mention of what this value should be on desktop). I'm having a lot of trouble finding information about how to retrieve these values in PHP or Javascript (I only find mention for getting them in the iOS / Android API's).

I'm assuming this must be possible or they wouldn't be asking for these HTML tags to contain these values. If anyone can point me in the right direction for how the attribute should be completed using PHP or JS that would be great (for desktop devices as well, if possible).

(I have the same question about how to retrieve the user's "Limit Ad Tracking" setting for the "dc_lat" and the value for "tag_for_child_directed_treatment" attributes.) Thanks!


Solution

  • Basically IDFA and AdID is part of device information attributes. You can't get either IDFA or AdID from desktop apps as well as PHP. User can be disable or reset it at will, as like as user clear the browser cookies

    If you work with javascript stuff, you can grab those two data using javascript stuff such as react, as below :