Amphtml: amp-iframe: make client-ID accessible

Created on 17 Aug 2016  路  13Comments  路  Source: ampproject/amphtml

We want to display personalized content in an amp-iframe. Therefor we need to access the Client-ID in the embedded document.
From my understanding this would be possible in iframes served from the same origin as the document by reading the cookie, but not if the document is delivered via the AMP-CDN.
Would it be possible to solve this by enabling the "URL Variable Substitutions" for amp-iframe, or maybe by taking a similar approach to amp-ad?

DiscussioQuestion

Most helpful comment

The initial request was to only make the CLIENT_ID available in iframes. Not necessarily all variable substitutions. Would this be viable?

iframes are often the only way to realise complex integrations. Being able to personalise their content is a common use case which AMP currently doesn't support.

All 13 comments

URL substitution does sound a reasonable solution to me.

What amp-ad approach were you talking about?

/cc @rudygalfi

@lannka from what i understand the ad is able to access the "AMP client id". Am I mistaken? I thought maybe a similar behavoir could be applied.

I've encountered the same problem when creating the amp-analytics sample for ABE. Support for variable substitutions in iframes would've definitely helped.

@eike-hass I see what you mean. But that's probably not what you want. That gives you the ad-cid, which has its own scope per ad network.

@lannka gotcha. thank you for clearifying

@rudygalfi do you see any risk of exposing all runtime variables to iframe src? Otherwise I think it's something we can do.

At first glance, I don't see concerns.

We do not want to make variable substitution available to amp-iframe, because that opens up usage of it for undesired purposes such as ad serving and analytics.

The initial request was to only make the CLIENT_ID available in iframes. Not necessarily all variable substitutions. Would this be viable?

iframes are often the only way to realise complex integrations. Being able to personalise their content is a common use case which AMP currently doesn't support.

Basically we'd be more comfortable to allow everything but CLIENT_ID.

why are ad serving and analytics undesired purposes?

Was this page helpful?
0 / 5 - 0 ratings