如何将亚马逊关联广告小部件插入网站

How to insert amazon associate ad widget into website

Github Repo(使用虚拟 ID(有效))

更新: 看起来问题可能是我尝试使用的广告小部件需要 flash。我还可以展示其他亚马逊广告(查看 github 回购),但看起来一些更具体的小部件可能正在使用 flash。我认为使用 flash 小部件可能不是一个好主意,但 Amazon Associate 网站上向我推荐的一些小部件可能只能使用 flash。


我正在尝试插入 deals widget。我 select 我想要一个 160x400 的侧边栏(我的示例中的每个内部 div 大约是 520x100)。当我单击 "Add to my webpage" 时,他们给我以下弹出窗口 window,因此我将该代码复制并粘贴到我的 html 文件中。

我不知道具体放在哪里,所以我尝试了多个地方,包括头部、body 和左侧的 innerDiv 内部,如下面的代码片段所示。 None 这些尝试使小部件显示出来。

注意: 文本 my-amazon-associate-id 用于替换我实际的 amazon associate id,因此 link 无法正常工作但我不得不更换它以遵守亚马逊的政策。

#container{
    display: flex;
    height: 1000px;
    align-items: center;
    justify-content: center;
}

.innerDiv{
    display:flex;
    align-items: center;
    justify-content: center;
    width: 33%;
    height: 100%;
}
<!doctype html>

<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Test Webpage</title>
  <link rel="stylesheet" type="text/css" href="./css/style.css">
  <SCRIPT charset="utf-8" type="text/javascript" src="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&MarketPlace=CA&ID=V20070822%2FCA%my-amazon-associate-id%2F8009%2F4246f29c-6400-4a95-9cdd-994f55f4a2dc&Operation=GetScriptTemplate"> </SCRIPT> <NOSCRIPT><A rel="nofollow" HREF="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&MarketPlace=CA&ID=V20070822%2FCA%my-amazon-associate-id%2F8009%2F4246f29c-6400-4a95-9cdd-994f55f4a2dc&Operation=NoScript">Amazon.ca Widgets</A></NOSCRIPT>
</head>

<body>
  <div id="container">
    <div class='innerDiv'>
      <SCRIPT charset="utf-8" type="text/javascript" src="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&MarketPlace=CA&ID=V20070822%2FCA%my-amazon-associate-id%2F8009%2F4246f29c-6400-4a95-9cdd-994f55f4a2dc&Operation=GetScriptTemplate"> </SCRIPT> <NOSCRIPT><A rel="nofollow" HREF="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&MarketPlace=CA&ID=V20070822%2FCA%my-amazon-associate-id%2F8009%2F4246f29c-6400-4a95-9cdd-994f55f4a2dc&Operation=NoScript">Amazon.ca Widgets</A></NOSCRIPT>
    </div>
    <div class='innerDiv'>
      Hello World
    </div>
    <div class='innerDiv'>
      World
    </div>
  </div>
  <SCRIPT charset="utf-8" type="text/javascript" src="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&MarketPlace=CA&ID=V20070822%2FCA%my-amazon-associate-id%2F8009%2F4246f29c-6400-4a95-9cdd-994f55f4a2dc&Operation=GetScriptTemplate"> </SCRIPT> <NOSCRIPT><A rel="nofollow" HREF="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&MarketPlace=CA&ID=V20070822%2FCA%my-amazon-associate-id%2F8009%2F4246f29c-6400-4a95-9cdd-994f55f4a2dc&Operation=NoScript">Amazon.ca Widgets</A></NOSCRIPT>
</body>
</html>


肯定有一些我不知道的非常简单的东西,因为这看起来并不难,不要以为我在这方面有任何常识。

编辑: 你可以试试这个:

<iframe src="/other_page_in_my_site.html"></iframe>

并填写/other_page_in_my_site.html以下内容:

<html>
 <body>
  <SCRIPT charset="utf-8" type="text/javascript" src="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&MarketPlace=CA&ID=V20070822%2FCA%my-amazon-associate-id%2F8009%2F4246f29c-6400-4a95-9cdd-994f55f4a2dc&Operation=GetScriptTemplate"> </SCRIPT> <NOSCRIPT><A rel="nofollow" HREF="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&MarketPlace=CA&ID=V20070822%2FCA%my-amazon-associate-id%2F8009%2F4246f29c-6400-4a95-9cdd-994f55f4a2dc&Operation=NoScript">Amazon.ca Widgets</A></NOSCRIPT>
 </body>
</html>

注意使用亚马逊网站的代码获取真实代码。

另一个可能的问题来源可能是在您的浏览器中禁用了 Flash。

另一个可能的问题来源可能是启用了 AD 拦截器。

希望这对您有所帮助。

#container{
    display: flex;
    height: 1000px;
    align-items: center;
    justify-content: center;
}

.innerDiv{
    display:flex;
    align-items: center;
    justify-content: center;
    width: 33%;
    height: 100%;
}
<!doctype html>

<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Test Webpage</title>
  <link rel="stylesheet" type="text/css" href="./css/style.css">
  <SCRIPT charset="utf-8" type="text/javascript" src="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&MarketPlace=CA&ID=V20070822%2FCA%my-amazon-associate-id%2F8009%2F4246f29c-6400-4a95-9cdd-994f55f4a2dc&Operation=GetScriptTemplate"> </SCRIPT> <NOSCRIPT><A rel="nofollow" HREF="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&MarketPlace=CA&ID=V20070822%2FCA%my-amazon-associate-id%2F8009%2F4246f29c-6400-4a95-9cdd-994f55f4a2dc&Operation=NoScript">Amazon.ca Widgets</A></NOSCRIPT>
</head>

<body>
  <div id="container">
    <div class='innerDiv'>
      <SCRIPT charset="utf-8" type="text/javascript" src="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&MarketPlace=CA&ID=V20070822%2FCA%my-amazon-associate-id%2F8009%2F4246f29c-6400-4a95-9cdd-994f55f4a2dc&Operation=GetScriptTemplate"> </SCRIPT> <NOSCRIPT><A rel="nofollow" HREF="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&MarketPlace=CA&ID=V20070822%2FCA%my-amazon-associate-id%2F8009%2F4246f29c-6400-4a95-9cdd-994f55f4a2dc&Operation=NoScript">Amazon.ca Widgets</A></NOSCRIPT>
    </div>
    <div class='innerDiv'>
      Hello World
    </div>
    <div class='innerDiv'>
      World
    </div>
  </div>
  <SCRIPT charset="utf-8" type="text/javascript" src="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&MarketPlace=CA&ID=V20070822%2FCA%my-amazon-associate-id%2F8009%2F4246f29c-6400-4a95-9cdd-994f55f4a2dc&Operation=GetScriptTemplate"> </SCRIPT> <NOSCRIPT><A rel="nofollow" HREF="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&MarketPlace=CA&ID=V20070822%2FCA%my-amazon-associate-id%2F8009%2F4246f29c-6400-4a95-9cdd-994f55f4a2dc&Operation=NoScript">Amazon.ca Widgets</A></NOSCRIPT>
</body>
</html>