# How to insert Amazon iframe on posts

**URL:** https://meta.discourse.org/t/how-to-insert-amazon-iframe-on-posts/187922
**Category:** Support
**Created:** [April 23, 2021, 4:46pm UTC](https://meta.discourse.org/t/how-to-insert-amazon-iframe-on-posts/187922 "2021-04-23T16:46:32Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![mstm](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@mstm](https://meta.discourse.org/u/mstm)
#### Post date: [April 23, 2021, 4:46pm UTC](https://meta.discourse.org/t/how-to-insert-amazon-iframe-on-posts/187922/1 "2021-04-23T16:46:32Z")

</div>

Hello, considering that onebox seems not to work properly with amazon other than .com (since 2019, [info](https://meta.discourse.org/t/amazon-link-preview-works-here-but-not-on-my-forum/187142)), I would like to try using iframes.

The code to insert is:  
`<iframe style="width:120px;height:240px;" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" src="//rcm-eu.amazon-adsystem.com/e/cm?lt1=_blank&bc1=000000&IS2=1&bg1=FFFFFF&fc1=000000&lc1=0000FF&t=TAG_REMOVED&language=it_IT&o=29&p=8&l=as4&m=amazon&f=ifr&ref=as_ss_li_til&asins=B07WHMHLJQ&linkId=69e9808ddc7b121e4fa9d501cdac312e"></iframe>`

I entered the following addresses in the option `allowed iframes`  
[https://rcm-eu.amazon-adsystem.com/](https://rcm-eu.amazon-adsystem.com/)  
[https://www.amazon.it](https://www.amazon.it)

But I don’t see the banner, where am I wrong?  
Obviously there are no active adblocks.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [April 23, 2021, 10:09pm UTC](https://meta.discourse.org/t/how-to-insert-amazon-iframe-on-posts/187922/2 "2021-04-23T22:09:50Z")

</div>

> [@mstm](#):
>
> I entered the following addresses in the option `allowed iframes`  
> [https://rcm-eu.amazon-adsystem.com/](https://rcm-eu.amazon-adsystem.com/)  
> [https://www.amazon.it](https://www.amazon.it)

You could try just entering `//rcm-eu.amazon-adsystem.com` into the `allowed iframes` site setting. I think that will display an iframe, but it might not look very good. If you try this, you’ll need to rebuild the HTML for any existing posts that you’ve added the iframe to.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [April 23, 2021, 10:18pm UTC](https://meta.discourse.org/t/how-to-insert-amazon-iframe-on-posts/187922/3 "2021-04-23T22:18:17Z")

</div>

You don’t need an iframe. You can use their snippets directly.

Btw Oneboxing would break your affiliate agreement as they would not be happy with the use of their logo in that way. They once closed my account for that transgression.

---

<div class="post-metadata">

### Author: ![mstm](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@mstm](https://meta.discourse.org/u/mstm)
#### Post date: [April 24, 2021, 8:42am UTC](https://meta.discourse.org/t/how-to-insert-amazon-iframe-on-posts/187922/4 "2021-04-24T08:42:38Z")

</div>

Thanks Simon, with `//rcm-eu.amazon-adsystem.com` the iframes are seen but like this

 ![Immagine 2021-04-24 103013](https://global.discourse-cdn.com/meta/original/3X/7/c/7c31061d0206d530fc6a5bf0cbffb8bb611e902f.png)

> [@merefield](#):
>
> You don’t need an iframe. You can use their snippets directly.

Only with [amazon.com](http://amazon.com) you can also create links to images ☹

 ![amazon](https://global.discourse-cdn.com/meta/original/3X/7/b/7b63a1fafb872ff0cfa94fa49cd29936314931b2.png)  
Text + Image create only an iframe… for this I was hoping that onebox would work with Amazon other than .com but maybe this is not a priority for developers.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [April 24, 2021, 9:02am UTC](https://meta.discourse.org/t/how-to-insert-amazon-iframe-on-posts/187922/5 "2021-04-24T09:02:52Z")

</div>

Yep that’s true, only works with image snippets, text+image renders an iframe.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [April 24, 2021, 9:55am UTC](https://meta.discourse.org/t/how-to-insert-amazon-iframe-on-posts/187922/6 "2021-04-24T09:55:25Z")

</div>

I think this is just a trivial CSS issue, try:

```plaintext
.topic-post iframe {
    height: 240px;
}

```

Adjust as you see fit.

NB Bear in mind that will affect all iframes in posts.

You could get more specific using the `data-post-id`, `data-topic-id` or even the `data-user-id`

---

<div class="post-metadata">

### Author: ![mstm](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@mstm](https://meta.discourse.org/u/mstm)
#### Post date: [April 25, 2021, 9:04am UTC](https://meta.discourse.org/t/how-to-insert-amazon-iframe-on-posts/187922/7 "2021-04-25T09:04:45Z")

</div>

Thanks @merefield, forum users don’t like this solution very much but I don’t have other alternatives.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [April 25, 2021, 9:56am UTC](https://meta.discourse.org/t/how-to-insert-amazon-iframe-on-posts/187922/8 "2021-04-25T09:56:04Z")

</div>

I use image snippets inside a Markdown table. Allows me to add affiliate disclaimer above the link. Lack of a disclaimer is likely to incur Amazon wrath too 😬

---

<div class="post-metadata">

### Author: ![mstm](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@mstm](https://meta.discourse.org/u/mstm)
#### Post date: [April 25, 2021, 10:16am UTC](https://meta.discourse.org/t/how-to-insert-amazon-iframe-on-posts/187922/9 "2021-04-25T10:16:05Z")

</div>

> [@merefield](#):
>
> I use image snippets inside a Markdown table

Great idea!  
Can you give me an markdown table example?

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [April 25, 2021, 10:21am UTC](https://meta.discourse.org/t/how-to-insert-amazon-iframe-on-posts/187922/10 "2021-04-25T10:21:15Z")

</div>

Sure, something like:

```plaintext
<sup>*(NB from admin: As an Amazon Associate I earn from qualifying purchases. Thanks for your support!)*

|Albott Pro Stunt Scooter|
|:-:|
|<AMAZON LARGE IMAGE SNIPPET>|

```

One of the advantages of this approach btw, is Discourse keeps a counter by the image for the number of times it’s been clicked 🙂 🚀

---

<div class="post-metadata">

### Author: ![mstm](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@mstm](https://meta.discourse.org/u/mstm)
#### Post date: [April 25, 2021, 10:28am UTC](https://meta.discourse.org/t/how-to-insert-amazon-iframe-on-posts/187922/11 "2021-04-25T10:28:38Z")

</div>

It’s perfect, thank you! 😀

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [May 25, 2021, 10:29am UTC](https://meta.discourse.org/t/how-to-insert-amazon-iframe-on-posts/187922/12 "2021-05-25T10:29:36Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
