{"id":828,"date":"2020-02-17T09:54:37","date_gmt":"2020-02-17T09:54:37","guid":{"rendered":"http:\/\/adsforwp.com\/docs\/?post_type=ht_kb&#038;p=828"},"modified":"2020-02-17T09:55:16","modified_gmt":"2020-02-17T09:55:16","slug":"how-to-add-amazon-affiliate-ads-in-custom-code","status":"publish","type":"ht_kb","link":"https:\/\/adsforwp.com\/docs\/article\/how-to-add-amazon-affiliate-ads-in-custom-code\/","title":{"rendered":"How to add Amazon affiliate ads in custom code?"},"content":{"rendered":"\n<p>Are you getting started with Amazon affiliate advertising? which helps you find, attract, and engage millions of Amazon customers at every stage of their journey, The Ads provide highly relevant and dynamic product recommendations in a stylishly designed and responsive ad unit that can be placed at the end of content or within the content to create a more compelling visitor experience and shopping opportunity.<\/p>\n\n\n\n<p><strong>And the same Ads you want to show in AMP then you need to follow these steps:<\/strong><\/p>\n\n\n\n<p><strong>Step 1:<\/strong>&nbsp;You can download&nbsp;<strong><a href=\"https:\/\/wordpress.org\/plugins\/ads-for-wp\/\">ADSforWP<\/a><\/strong>&nbsp;Plugin it\u2019s a free plugin you can download from WordPress<a href=\"https:\/\/wordpress.org\/plugins\/ads-for-wp\/\">.<\/a><\/p>\n\n\n\n<p><strong>This is an example of AMP-compatible code of the Amazon Ads:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;amp-ad\n  width=\"600\"\n  height=\"250\"\n  type=\"a9\"\n  data-amzn_assoc_placement=\"adunit0\"\n  data-amzn_assoc_search_bar=\"true\"\n  data-amzn_assoc_tracking_id=\"deepak0004-20\"\n  data-amzn_assoc_ad_mode=\"manual\"\n  data-amzn_assoc_ad_type=\"smart\"\n  data-amzn_assoc_marketplace=\"amazon\"\n  data-amzn_assoc_region=\"US\"\n  data-amzn_assoc_title=\"My Amazon Picks\"\n  data-amzn_assoc_linkid=\"c5772783a7d25620cd6226c5cc5885c8\"\n  data-amzn_assoc_asins=\"B001AWZDA4,B07BFTFYZC,B06XD8XQWK,B018HTGSN8\"\n>\n&lt;\/amp-ad><\/code><\/pre>\n\n\n\n<p>For more info of\u00a0\u00a0<strong>Amazon affiliate<\/strong> <strong>Ad<\/strong>\u00a0<a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/master\/ads\/a9.md\">Click Here<\/a>.<\/p>\n\n\n\n<p><strong>Step 2:<\/strong>&nbsp;After installing this plugin Ads option will be displayed on the&nbsp;<strong>WordPress dashboard<\/strong>&nbsp;-&gt;<strong>Ads Option<\/strong>&nbsp;-&gt;&nbsp;<strong>create new Ads.<\/strong><\/p>\n\n\n\n<p><strong>Step 3:<\/strong>\u00a0In Ad Type, you need to select the <strong>Custom Code Option<\/strong>.<\/p>\n\n\n\n<p><strong>Step 4:\u00a0<\/strong>In this option, you need to enter the body code of <strong>Amazon affiliate ad<\/strong><\/p>\n\n\n\n<p><strong>Step 5:<\/strong>\u00a0Click on \u201c<strong>Publish<\/strong>\u201d button your Auto Ads will be displayed on AMP pages.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1344\" height=\"435\" src=\"https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2020\/02\/1-1024x331.png\" alt=\"\" class=\"wp-image-830\" srcset=\"https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2020\/02\/1-1024x331.png 1024w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2020\/02\/1-300x97.png 300w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2020\/02\/1-768x249.png 768w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2020\/02\/1-50x16.png 50w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2020\/02\/1-60x19.png 60w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2020\/02\/1-100x32.png 100w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2020\/02\/1.png 1344w\" sizes=\"auto, (max-width: 1344px) 100vw, 1344px\" \/><\/figure>\n\n\n\n<p><strong>Required parameters<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>data-amzn_assoc_ad_mode<\/code>&nbsp;\u2013 specify the ad type as search, manual or auto (for recommendation ads)<\/li><\/ul>\n\n\n\n<p>Scroll down a little to see this option<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"display\">Display<\/h4>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"874\" height=\"312\" src=\"https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/05\/3-1.png\" alt=\"\" class=\"wp-image-163\" srcset=\"https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/05\/3-1.png 874w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/05\/3-1-300x107.png 300w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/05\/3-1-768x274.png 768w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/05\/3-1-50x18.png 50w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/05\/3-1-60x21.png 60w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/05\/3-1-100x36.png 100w\" sizes=\"auto, (max-width: 874px) 100vw, 874px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Display Type:<\/strong>&nbsp;In Display type, you\u2019ll see the number of display type which you can use as per your convenience. However, if you want to display the InContent Ads as the name suggests it is used to display the ads in the content of your post by simply putting between the paragraphs.<\/li><li><strong>Position:<\/strong>&nbsp;In this option, you\u2019ll see two Position\u2019s in which you can display the ad\u2019s by selecting&nbsp;1.)&nbsp;50% of the content&nbsp;&nbsp;2.)&nbsp;The number of paragraph option in which It asks you to enter the paragraph number to display the ads.<\/li><li><strong>Alignment:&nbsp;<\/strong>This option allows you to select the alignment option of the ad.<\/li><li><strong>Margin:&nbsp;<\/strong>You can also set the margins of the ads as per your taste.<\/li><li><strong>Embed Shortcode:<\/strong>&nbsp;Copy the shortcode and place where you want to display the Sticky Ads.<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"advanced-display-conditions\"><strong>Advanced Display Conditions<\/strong><\/h4>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"880\" height=\"229\" src=\"https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/05\/4.png\" alt=\"\" class=\"wp-image-130\" srcset=\"https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/05\/4.png 880w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/05\/4-300x78.png 300w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/05\/4-768x200.png 768w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/05\/4-50x13.png 50w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/05\/4-60x16.png 60w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/05\/4-100x26.png 100w\" sizes=\"auto, (max-width: 880px) 100vw, 880px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>In this section, you need to set the condition for the specific post or page or all posts where you want to show MGID Ads.<\/li><\/ul>\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 or do you want us to create compatibility for any other Ad company which isn\u2019t listed in our plugin then you can request us we will surely implement it as soon as possible.<\/p>\n\n\n\n<p><strong>Just contact us&nbsp;<a href=\"http:\/\/www.adsforwp.com\/contact\/\">here&nbsp;<\/a>and we are always available for you.<\/strong><br><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Are you getting started with Amazon affiliate advertising? which helps you find, attract, and engage millions of Amazon customers at every stage of their journey, The Ads provide highly relevant and dynamic product recommendations in a stylishly designed and responsive ad unit that can be placed at the end of&#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-828","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\/828","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=828"}],"version-history":[{"count":3,"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/ht-kb\/828\/revisions"}],"predecessor-version":[{"id":832,"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/ht-kb\/828\/revisions\/832"}],"wp:attachment":[{"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/media?parent=828"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/ht-kb-category?post=828"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/ht-kb-tag?post=828"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}