Re: How to retrive the landing page for Double click Ad

476 views
Skip to first unread message

Joseph DiLallo (DFA API Team)

unread,
Apr 8, 2013, 3:42:10 PM4/8/13
to google-doubleclick-...@googlegroups.com
Hello Siva,

The way you set click-through URLs varies for different ad types. This is why you don't see a field containing it in the base Ad object. It's also possible for one ad to have multiple click-through URLs, one for each creative associated with it. To do this for most cases you'd have to:
  1. After you call getAds, you'll have to determine what type of ad each object represents. You can do this by inspecting the typeId field (see AdType for what the values mean) and casting the ad object to the appropriate class, or just do instanceof checks or the like.
  2. You're allowed to set a different click-through URL for each creative associated with an ad. Find the CreativeAssignment object(s) in the ad. Some types such as DefaultAd have just one, while others like RotationGroup can have many.
  3. Pull the ClickThroughUrl(s) out of the CreativeAssignment(s).
  4. Now with each ClickThroughUrl...
    • If there's a customClickThroughUrl set, that's the URL.
    • If you have a landingPageId (and customClickThroughUrl is null), fetch the LandingPage from the campaign service and see what the URL is.
    • If defaultLandingPageUsed is true, you need to fetch the Campaign from the campaign service and see what its default landing page ID is. Then proceed as in the step above.
Getting all of the possible click-through URLs can actually be a bit complicated... there are edge cases where the above steps aren't guaranteed to work. For example, if the ad is using Flash In-Page creatives, its possible that the advertiser could be using clickTag parameters to insert the click-through URLs. (It's also possible to hard-code click-through URLs into your Flash creatives, in which case the actual click-through URL isn't stored in DFA anywhere outside the creative asset)

Regards,
- Joseph DiLallo, the DFA API Team

On Monday, April 8, 2013 8:30:57 AM UTC-4, sivakumar reddy wrote:

We are trying to retrieve the landing page URL for double click Ad, created by our user.  We are using DFA API (https://developers.google.com/doubleclick-advertisers/docs/overview) for Administration purpose.

We are using the "getAds" method listed in the DFA Admin API (https://developers.google.com/doubleclick-advertisers/docs/reference/v1.19/ad/service#getAds) to retrive the list of Ads associated for a Ad Campaign / Advertiser Id.

We want to extract the landing page url for each of the Ad that is retrieve by the above method if provided the user for each of the Ad  or Is there any other way to retrieve this data.
 
We found the "ClickThroughUrl" object in the Admin DFA API (), which says "An object representing the click-through URL of an ad object.", but did not find a way to extract the click through URL associated with an ad object.
 

Appreciate your help.

Thank you,

Siva kumar.

sivakumar reddy

unread,
Apr 10, 2013, 9:37:20 AM4/10/13
to google-doubleclick-...@googlegroups.com

Hello Joseph,

Thanks for your detailed reply. The above steps given by you really helped me in completing the task for us.

Still i have similar sort of questions, related to Site.

How can we retrive the SiteId associated to an Ad object?  We are using the same sort of approach as mentioned in first post. getAds method and then want to know the Site Id associated for each Ad retrieved.

Thank you.

Siva kumar.

 
 

 

Reply all
Reply to author
Forward
0 new messages