-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[amp-subscription] for ad-free site #32961
Comments
We do not recommend the iframe approach because for a large number of browsers the data will not be stored in local storage when the frame is cross origin. Additionally it won't buy you much in terms of latency because the iframe won't load until the page is visible and will probably take longer to load than the SwG entitlements call. You should be able to control ad display by putting the |
@jpettitt, thanks for the clarification and the valuable insights. We will set However, we'll go with "false" for now, but we need to make sure, that it won't affect indexing of the AMP pages. Do you have any shareable insights here? I wasn't aware of the local storage problems within a cross origin frame, we definitely have to rethink our implementation here. While the local service is required, we have to provide a correctly configured "remote" service. It's not a problem to set it up, but for our setup - a pure Google SignIn and SwG solution - it's not really the best option. In my opinion we could skip it completely and avoid any call at all because SwG - for our AMP implementation - is the only source of thruth. Showing/Hiding ads are non-critical for us, our AMP version avoids ads in the first viewport. Adding Again, thanks for your help, really appreciate it. |
Please file a separate issue for We recommend using the AMP reader Id as a user lookup key. If you associate the reader Id with your google sign in token on your backend you can make the server to server api query for the subscription data. That said on google.com search results the google login cookies are present (google.com is the top level domain and so 1st party). This means that the SwG entitlements call will work. There are three cases
The AMP reader ID is a consistent token for a specific device/surface/browser/publisher combination - you can associate it on a back end system with a subscription or a Google sign in token to retrieve a subscription. You would need to handle a user having multiple reader ID's as it will be different in different browsers (desktop / mobile or even 2 different mobile browsers on the same device). Webviews in apps are an unknown as every app developer implements them differently and the storage is visible to the app and so untrusted. |
We know that SWG was developed mainly for real paywalls and premium content. However, we want to use SwG for an ad-free site and not only in the WWW version, but also via AMP.
To make it even more complex, we don't use any accounts on our site and we don't store any data on our servers for privacy reasons. We only use the LocalStorage to store necessary data and to keep it for performance reasons.
In fact, this works perfectly in the WWW version. In combination with Google SignIn (via server-side oAuth) and SwG we get all the signals we need to make the site ad-free or not.
Under AMP it's a bit different - and here we need your help.
If we include amp-subscriptions and configure a local service (via amp-access-iframe - #21395) and additionally SwG, it works, but with limitations:
In principle, every article is accessible and readable for everyone. A subscription with us would only hide the banners. However, "isAccessibleForFree: true" ensures that the Entitlements are not retrieved. The behavior here differs from the normal web implementation, where the property can remain set to "false" and the Entitlements will still be retrieved.
Works fine, thanks for this solution. We can use it to switch to our TLD without any problems and fetch the data stored in LocalStorage.
However, this seems pointless - at least for our case - to create a local service at all:
Another problem is the lack of mechanisms to show or hide ads. What works fine with amp-access, unfortunately did not work with subscription-display.
Maybe we abuse SwG too much, but we find the use of SwG for an ad-free version really exciting. Especially in combination without own login and without own paywall.
The text was updated successfully, but these errors were encountered: