{"id":10978,"date":"2019-06-11T11:28:07","date_gmt":"2019-06-11T11:28:07","guid":{"rendered":"https:\/\/ampforwp.com\/tutorials\/?post_type=ht_kb&#038;p=10978"},"modified":"2019-06-14T09:32:28","modified_gmt":"2019-06-14T09:32:28","slug":"how-to-add-viglink-in-amp","status":"publish","type":"ht_kb","link":"https:\/\/ampforwp.com\/tutorials\/article\/how-to-add-viglink-in-amp\/","title":{"rendered":"How to add viglink in AMP"},"content":{"rendered":"\n<p><strong>If you want to add Viglink<\/strong> <strong>affiliate ad network<\/strong> <strong> in AMP then follow these three steps<\/strong><\/p>\n\n\n\n<p><strong>1. Enter HTML in Head:<\/strong> Add the below code in the \u201cEnter Html in head\u201d section from Advance settings. <\/p>\n\n\n\n<p><strong>Here is the code:<\/strong><\/p>\n\n\n\n<pre><script async custom-element=\"amp-link-rewriter\" src=\"https:\/\/cdn.ampproject.org\/v0\/amp-link-rewriter-0.1.js\"><\/script><\/pre>\n\n\n\n<p><strong>2. Enter HTML in Body (beginning of body tag): <\/strong>Add the below code in \u201cHTML in body\u201d section from Advance setting.<\/p>\n\n\n\n<p><strong>3. <\/strong>In this code, you need to enter your API key and you will get this key from <a href=\"https:\/\/support.viglink.com\/hc\/en-us\/articles\/360007678554-How-do-I-find-my-API-key-and-my-secret-key-\">Here<\/a>.  <\/p>\n\n\n\n<p><strong>Here is the code:<\/strong><\/p>\n\n\n\n <pre>\n<amp-link-rewriter layout=\"nodisplay\">\n  <script type=\"application\/json\">\n   {\n     \"output\": \"https:\/\/redirect.viglink.com?key=${apiKey}&u=${href}&type=ap&loc=SOURCE_URL&ref=DOCUMENT_REFERRER\",\n     \"vars\":\n     {\n      \"apiKey\": \"YOUR_API_KEY_HERE\"\n     }\n   }\n  <\/script>\n<\/amp-link-rewriter>  <\/pre> \n\n\n\n<p><strong> <\/strong>You will find this option in <strong>Amp option panel<\/strong> -&gt;  <strong>Setting<\/strong>s  -&gt;  <strong>Advance settings<\/strong>, there you will find options.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"488\" src=\"https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/06\/ads-1-1024x488.png\" alt=\"\" class=\"wp-image-10981\" srcset=\"https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/06\/ads-1-1024x488.png 1024w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/06\/ads-1-300x143.png 300w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/06\/ads-1-768x366.png 768w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/06\/ads-1-50x24.png 50w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/06\/ads-1-60x29.png 60w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/06\/ads-1-100x48.png 100w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/06\/ads-1.png 1322w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>That\u2019s it for this tutorial!<\/strong><\/p>\n\n\n\n<p>We hope it helped you. If you have any feedback or questions, then please share them in the comments section below.<\/p>\n\n\n\n<p><br><\/p>\n<div id=\"div-1\" class=\"hkb-feedback\">\n\t\t\t<strong class=\"ht-mobile-exit__title\">Ask your Questions Directly!<\/strong><br>\n\t\t\t<div class=\"hkb_widget_exit__content\" style=\"font-size: 14px;\">If you can't find the solutions in this article, then just ask us in the comments and we will answer it for you!<\/div>\n\t\t\t<a href=\"https:\/\/ampforwp.com\/support\/#contact\" id=\"button\" target=\"_blank\" rel=\"noopener noreferrer\"><button>Yes, I have a Question<\/button><\/a>\n\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>If you want to add Viglink affiliate ad network in AMP then follow these three steps 1. Enter HTML in Head: Add the below code in the \u201cEnter Html in head\u201d section from Advance settings. Here is the code: 2. Enter HTML in Body (beginning of body tag): Add the&#8230;<\/p>\n","protected":false},"author":18,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":[],"ht-kb-category":[34],"ht-kb-tag":[],"_links":{"self":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/10978"}],"collection":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/comments?post=10978"}],"version-history":[{"count":58,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/10978\/revisions"}],"predecessor-version":[{"id":11085,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/10978\/revisions\/11085"}],"wp:attachment":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/media?parent=10978"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb-category?post=10978"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb-tag?post=10978"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}