Example installation of the Outbrain widget
<amp-embed width="100" height="100" type="outbrain" layout="responsive" data-widgetIds="AMP_1,AMP_2"> </amp-embed>
The above code must be accompanied by AMP-enabled widgets delivered by Outbrain’s Account Management Team, do not directly install this code with existing widgets.
For details on the configuration semantics, please contact Outbrain’s Account Management Team.
widgetIds: Widget Id/s Provided by Account Manager.
htmlURL: The URL of the standard html version of the page.
ampURL: The URL of the AMP version of the page.
styleFile: Provide publisher an option to pass CSS file in order to inherit the design for the AMP displayed widget. Consult with Account Manager regarding CSS options.
The widget will check for user consent to decide whether personalized or non-personalized recommendations should be displayed.
The following rules will be apllied:
- CONSENT_POLICY_STATE.SUFFICIENT - Show personalized recommendations
- CONSENT_POLICY_STATE.INSUFFICIENT - Show non-personalized recommendations only
- CONSENT_POLICY_STATE.UNKNOWN_NOT_REQUIRED - Show personalized recommendations
- CONSENT_POLICY_STATE.UNKNOWN - Show non-personalized recommendations only
Widget is cut off
According to the AMP API, "resizes are honored when the resize will not adjust the content the user is currently reading. That is, if the ad is above the viewport's contents, it'll resize. Same if it's below. If it's in the viewport, it ignores it."
You can set an initial height of what the widget height is supposed to be. That is, instead of
height="100", if the widget's final height is 600px, then set
height="600". Setting the initial height will not finalize the widget height if it's different from the actual. The widget will resize to it's true dimensions after the widget leaves the viewport.