{"id":315,"date":"2019-06-11T11:52:28","date_gmt":"2019-06-11T11:52:28","guid":{"rendered":"http:\/\/adsforwp.com\/docs\/?post_type=ht_kb&#038;p=315"},"modified":"2019-06-14T09:28:54","modified_gmt":"2019-06-14T09:28:54","slug":"how-to-add-viglink-ad-with-amp-integration","status":"publish","type":"ht_kb","link":"https:\/\/adsforwp.com\/docs\/article\/how-to-add-viglink-ad-with-amp-integration\/","title":{"rendered":"How to add Viglink ad with AMP integration"},"content":{"rendered":"<p><strong>If you want to add Viglink<\/strong>\u00a0<strong>affiliate ad network<\/strong>\u00a0<strong>in AMP then follow this two steps<\/strong><\/p>\n<p><strong>1. Enter HTML in Head:<\/strong>\u00a0Add the below code in the \u201cEnter Html in head\u201d section from Advance settings.<\/p>\n<p><strong>Here is the code:<\/strong><\/p>\n<pre>&lt;script async custom-element=\u201damp-link-rewriter\u201d src=\u201dhttps:\/\/cdn.ampproject.org\/v0\/amp-link-rewriter-0.1.js\u201d&gt;&lt;\/script&gt;<\/pre>\n<p>Go to the\u00a0<strong>Amp option panel<\/strong>\u00a0-&gt;\u00a0<strong>Setting<\/strong>s -&gt;\u00a0<strong>Advance settings<\/strong>, there you will find options.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-317\" src=\"https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ads-setting-1.png\" alt=\"\" width=\"1308\" height=\"601\" srcset=\"https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ads-setting-1.png 1308w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ads-setting-1-300x138.png 300w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ads-setting-1-768x353.png 768w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ads-setting-1-1024x471.png 1024w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ads-setting-1-50x23.png 50w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ads-setting-1-60x28.png 60w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ads-setting-1-100x46.png 100w\" sizes=\"auto, (max-width: 1308px) 100vw, 1308px\" \/><\/p>\n<p><strong>2.<\/strong> Go to <strong>Ads <\/strong>\u00a0-&gt; <strong>Add new Ads<\/strong> -&gt; Select Customcode\u00a0 Ad Type -&gt; Add HTML markup<\/p>\n<p><strong>Custom Code: <\/strong>Add the below code in \u201cCustom code\u201d section from Ads.<\/p>\n<p><strong>3.\u00a0<\/strong>In this code, you need to enter your API key and you will get this key from\u00a0<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<p><strong>Here is the code:<\/strong><\/p>\n<pre>&lt;pre&gt;\r\n&lt;amp-link-rewriter layout=\"nodisplay\"&gt;\r\n  &lt;script type=\"application\/json\"&gt;\r\n   {\r\n     \"output\": \"https:\/\/redirect.viglink.com?key=${apiKey}&amp;u=${href}&amp;type=ap&amp;loc=SOURCE_URL&amp;ref=DOCUMENT_REFERRER\",\r\n     \"vars\":\r\n     {\r\n      \"apiKey\": \"YOUR_API_KEY_HERE\"\r\n     }\r\n   }\r\n  &lt;\/script&gt;\r\n&lt;\/amp-link-rewriter&gt;  &lt;\/pre&gt;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-320\" src=\"https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ads-setting-2.png\" alt=\"\" width=\"1347\" height=\"523\" srcset=\"https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ads-setting-2.png 1347w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ads-setting-2-300x116.png 300w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ads-setting-2-768x298.png 768w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ads-setting-2-1024x398.png 1024w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ads-setting-2-50x19.png 50w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ads-setting-2-60x23.png 60w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ads-setting-2-100x39.png 100w\" sizes=\"auto, (max-width: 1347px) 100vw, 1347px\" \/><\/p>\n<p><strong>That\u2019s it for this tutorial!<\/strong><\/p>\n<p>We hope we\u2019ve clear your doubts in case If you have any feedback or questions, then please share them in the comments section below.<\/p>\n<p>Or you Just contact us\u00a0<a href=\"http:\/\/www.adsforwp.com\/contact\/\"><strong>here<\/strong>\u00a0<\/a>and we are always available for you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you want to add Viglink\u00a0affiliate ad network\u00a0in AMP then follow this two steps 1. Enter HTML in Head:\u00a0Add the below code in the \u201cEnter Html in head\u201d section from Advance settings. Here is the code: &lt;script async custom-element=\u201damp-link-rewriter\u201d src=\u201dhttps:\/\/cdn.ampproject.org\/v0\/amp-link-rewriter-0.1.js\u201d&gt;&lt;\/script&gt; Go to the\u00a0Amp option panel\u00a0-&gt;\u00a0Settings -&gt;\u00a0Advance settings, there you will&#8230;<\/p>\n","protected":false},"author":3,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[18],"ht-kb-tag":[],"class_list":["post-315","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-how-to"],"_links":{"self":[{"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/ht-kb\/315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/comments?post=315"}],"version-history":[{"count":14,"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/ht-kb\/315\/revisions"}],"predecessor-version":[{"id":350,"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/ht-kb\/315\/revisions\/350"}],"wp:attachment":[{"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/media?parent=315"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/ht-kb-category?post=315"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/ht-kb-tag?post=315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}