amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Amp-ad: include client_id macro into amp-ad

Open gembarguk opened this issue 7 years ago • 30 comments

We would like to have client_id accessible inside our amp-ads through client_id macro, the same as we do it with amp-analytics component: (https://github.com/ampproject/amphtml/blob/master/spec/amp-var-substitutions.md#client-id).

Currently it is implemented for amp-list, but not for amp-ad. We tried to include amp-ads inside amp-list, but it's not working.

In the end we would like to get something like this, so that client-id will be assessable in amp-ads even when they are served via Google CDN:

image

By client_id we mean not PPID that is used in DFP, but the userId that we set as a cookie by amp-analytics script

gembarguk avatar Oct 22 '19 09:10 gembarguk

Another note from my side - this is not about doubleclick or any adnetwork specific features, just about enabling the client_id macro besides amp-analytics and links also for amp-ad, which doesn't seem to work right now.

martinschierle avatar Nov 26 '19 08:11 martinschierle

Doubleclick extension already sends CLIENT_ID(AMP_ECID_GOOGLE) in the ad request.

https://github.com/ampproject/amphtml/blob/3b5035c5ab38ee550170308b33932187f64c1d13/ads/google/a4a/utils.js#L276-L279

Do you mean that you want to access all CLIENT_ID?

/cc @keithwrightbos

lannka avatar Dec 11 '19 22:12 lannka

For other ad networks integrated using a cross-origin iframe, clientId is available through the context API: https://github.com/ampproject/amphtml/blob/master/ads/README.md#available-information-to-the-ad

lannka avatar Dec 11 '19 22:12 lannka

Amazing info, thanks a lot! This will help with a couple usecases (e.g. might make the Taboola case we discussed offline at least easier), but it will not help with cases where a publisher wants to push their own user ids into an ad network - for this the website owner would need to be able to use their own scope for the client_id instead of the one of the ad network.

martinschierle avatar Dec 12 '19 14:12 martinschierle

@martinschierle that makes sense. Probably AMP can provide full macro expansion here.

the json attribute is a doubleclick only feature, @keithwrightbos for input from doubleclick's point of view. Do publishers pass along cookie values in ad requests on non-AMP pages?

lannka avatar Dec 23 '19 18:12 lannka

Is there any update here? We have a couple monetization usecases which seem impacted by this?

martinschierle avatar Jan 31 '20 10:01 martinschierle

We discussed offline a bit more. It seems if our AMP RTC mechanism is used, it will expand clientID macros there, so that it can populate back into ad manager key-values. More docs here:

https://github.com/ampproject/amphtml/blob/master/extensions/amp-ad-network-doubleclick-impl/doubleclick-rtc.md

@gembarguk I think this should solve your usecase?

martinschierle avatar Feb 11 '20 16:02 martinschierle

@martinschierle Thank you, we are already using RTC, but I didn't find clientID among available macros there...

gembarguk avatar Feb 14 '20 10:02 gembarguk

Hi, @martinschierle That would also solve a similar use-case I am having trouble with. Could you confirm that CLIENTID macro will be added in any time soon? I tried this week using it and it doesn't work - also it isn't listed in the RTC documentation. What we have there is the ADCID, which doesn't really solve my particular issue.

massawho avatar Mar 24 '20 16:03 massawho

Hi folks,

We have received another request for this feature to be available. It's not uncommon for publishers to pass these kind of values to ad-servers, is there anything we can do to re-prioritize this request?

In the meantime, having some workaround could be of help.

Thanks.

cc // @kbarneyforbes @martinschierle

demianrenzulli avatar Apr 01 '20 13:04 demianrenzulli

Have there been any updates with this? We have been trying to use client_id in amp-ad for targeting.

kbarneyforbes avatar Apr 17 '20 20:04 kbarneyforbes

@jeffjose to chime in.

powerivq avatar Apr 24 '20 19:04 powerivq

We have discussed with the Doubleclick team are now planning on implementing this feature as soon as time permits.

calebcordry avatar May 14 '20 16:05 calebcordry

is the plan to expand variables within the doubleclick jsonattribute? OR it will be applied to all data- attributes?

zhouyx avatar May 14 '20 17:05 zhouyx

The idea was just to do the json attribute, do you think it would be better to change the scope?

calebcordry avatar May 14 '20 17:05 calebcordry

I don't have a preference. asked because the requirement was not clear to me. Thanks for the clarification.

zhouyx avatar May 14 '20 18:05 zhouyx

We are expecting to use it in the json attribute. Something like

<amp-ad height="251" width="321" type="doubleclick" data-block-on-consent data-slot="/7175/fdcmobile/article-amp/topline/default/standard" data-multi-size="321x251,300x250,320x50,300x50,1x1,300x251" data-multi-size-validation="false" rtc-config="{&quot;vendors&quot;: {&quot;medianet&quot;: {&quot;CID&quot;: &quot;8CU66O230&quot;}, &quot;aps&quot;: {&quot;PUB_ID&quot;: &quot;3038&quot;, &quot;PARAMS&quot;: {&quot;amp&quot;: &quot;1&quot;}}}}" json="{&quot;targeting&quot;:{&quot;amp&quot;:&quot;true&quot;,&quot;author&quot;:&quot;sarahhansen&quot;,&quot;channel&quot;:&quot;money&quot;,&quot;section&quot;:&quot;money:markets&quot;,&quot;type&quot;:&quot;forbesstaff&quot;,&quot;es&quot;:&quot;stocks,coronaVirus&quot;,&quot;badges&quot;:&quot;breaking-news&quot;,&quot;mobilex&quot;:&quot;0&quot;,&quot;fvid&quot;:&quot;${clientId}&quot;,&quot;pos&quot;:&quot;mobilerec&quot;,&quot;templatetype&quot;:&quot;topline&quot;,&quot;swimlane&quot;:&quot;&quot;,&quot;specialslot&quot;:&quot;&quot;,&quot;id&quot;:&quot;blogAndPostId/blog/post/5866-5ebd88effa7dab0006fe6109&quot;,&quot;brand&quot;:&quot;&quot;,&quot;strnativekey&quot;:&quot;13b84c32&quot;}}"></amp-ad>

kbarneyforbes avatar May 14 '20 19:05 kbarneyforbes

@kbarneyforbes I just noticed your example has the CID in rtc-config. My plan was to expand this macro in the json attributes targeting. Does this satisfy your use case?

Edit: never mind, I see it in targeting as well :)

calebcordry avatar May 21 '20 15:05 calebcordry

Leaving this issue open until experiment is fully launched.

calebcordry avatar Jun 09 '20 16:06 calebcordry

awesome, @calebcordry ! Has it been deployed? Do we have a documentation written for it? Thanks a lot!

massawho avatar Jun 10 '20 08:06 massawho