googleads / google-publisher-tag-samples

Google Publisher Tag (GPT) code samples.
https://developers.google.com/publisher-tag/samples
Apache License 2.0
38 stars 22 forks source link

Sample feedback: display-web-interstitial-ad/js #101

Closed piotrj-rtbh closed 1 month ago

piotrj-rtbh commented 1 month ago

The sample implementation of an interstitial ad at https://developers.google.com/publisher-tag/samples/display-web-interstitial-ad doesn't work. It shows a 100x100 small ad on the top-left and a text "Interstitial is loading..." doesn't disappear. image

jimper commented 1 month ago

Hi @piotrj-rtbh, the sample seems to be working normally for me.

When the loading message doesn't go away, it means the ad request for the interstitial slot didn't return an ad (so the slotOnLoad event never fires). You may have reached the frequency cap, which prevents showing the same user an interstitial more than once per hour per domain. You can try clearing the local storage and refreshing the page to see if that's the issue.

If that doesn't fix it, you'd need to take a look at the developer console and/or publisher console to see if there are any errors or warnings being logged.

piotrj-rtbh commented 1 month ago

Thank you @jimper I owe you a notice: I am from EEA region so EU user restrictions (GDPR, TCF) play role here. The console gave me: Interstitial /6355419/Travel/Europe/France/Paris not requested: Unable to access local storage to determine if the frequency cap has been exceeded due to insufficient user consent. [(Learn more)](https://developers.google.com/publisher-tag/guides/publisher-console-messages?utm_source=pubconsole#LOCAL_STORAGE_ACCESS) so it looks like GAM can't store data in localStorage due to the restrictions.

jimper commented 1 month ago

Ah, that would do it. This restriction is actually called out in the sample documentation:

Web interstitial ads require access to local storage. For publishers integrated with the IAB Transparency and Consent Framework v2.0, this means that consent for Purpose 1 is required for web interstitial ads to function.