Yes. Magnet Widgets are "AMP-compliant".
Note: for a successful integration, you should have a valid SSL certificate that’s configured on your webserver as per the Google AMP project guidelines.
Process:
- Place the file “KlangooWidget.html” (attached) on your website’s root directory.
- On each page you want to integrate a specific widget, the respective code found below should be added in place where the widget should appear.
e.g. Inside the article page, after the article’s body.
Widget Code:
<amp-iframe src='https:// {YourDomain} /KlangooWidget.html?payload={%22Url%22:% {Url} %22,%22Identifier%22: {Identifier} ,%22WidgetID%22:%22 {WidgetID} %22,%22Language%22:%22 {Language} %22}' |
Parameters:
These parameters are marked in red in the code section above.
- {YourDomain} : You should replace this text by your own domain name e.g. Klangoo.com
- {Url} : Refers to the unique URL for every article, this parameter is required and cannot be empty
- {Identifier}: Refers to the unique identifier for each article, also this parameter is required.
In case your unique identifier is the same as the {Url}, please do pass it again inside the {Identifier} parameter.
-
{WidgetID} : Refers to the unique widget ID assigned by the widget dashboard.
e.g. rel_00-1 -
{Language} : Refers to an optional parameter representing the 2 characters’ language code
e.g. en, ar, es, fr… if this parameter wasn’t passed, the default “en” will be used.
N.B.
Please note that in case you wil be adding multiple widgets on the same page, the above code should be used for the first widget ONLY, while the below code should be used for the subsequent widgets on the page*:
<amp-iframe src='https:// {YourDomain} /KlangooWidget.html?payload={%22Url%22:% {Url} %22,%22Identifier%22: {Identifier} ,%22WidgetID%22:%22 {WidgetID} %22,%22Language%22:%22 {Language} %22,%22dl%22:1 }' width="auto" height=100 layout="fixed-height" resizable sandbox="allow-scripts allow-same-origin allow-top-navigation" frameborder="0"> |
The “dl” parameter is a required parameter by Magnet to ensure that the script won't make multiple calls to our logging server.
Comments
0 comments
Article is closed for comments.