# Error Embedding

**URL:** https://meta.discourse.org/t/error-embedding/177504
**Category:** Support
**Created:** [January 28, 2021, 12:38am UTC](https://meta.discourse.org/t/error-embedding/177504 "2021-01-28T00:38:26Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![CaptainZac](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/captainzac/32/195184_2.png) [@CaptainZac](https://meta.discourse.org/u/CaptainZac)
#### Post date: [January 28, 2021, 12:38am UTC](https://meta.discourse.org/t/error-embedding/177504/1 "2021-01-28T00:38:26Z")

</div>

Can someone let me know what I’m doing wrong here. I keep getting an error for some reason…

 ![](https://global.discourse-cdn.com/meta/original/3X/0/9/09480462f3d8d4cc1e27cc16c2ce0f5c335af24d.png)  
 ![](https://global.discourse-cdn.com/meta/original/3X/e/9/e984b27ace29f5e5f5be5c3955f5ccf1a5377052.png)  
 ![](https://global.discourse-cdn.com/meta/original/3X/6/9/699ad05a8e6cc92c938ba094f54fd6d0e5d178c7.png)

---

<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: [January 28, 2021, 12:47am UTC](https://meta.discourse.org/t/error-embedding/177504/2 "2021-01-28T00:47:00Z")

</div>

The code in your final screenshot is showing the URL of a Discourse topic as the value of the `discourseEmbedUrl`. The `discourseEmbedUrl` should be set to the canonical URL of the page you are adding that code snippet to. For example, if the URL of the post you are adding the snippet to was `https://example.com/blog/my-new-blog-post`, that is the value that you would use for the `discourseEmbedUrl`.

It also looks like there may be a formatting issue in your code snippet. Notice the large amount of space between the opening `'` and the beginning of the URL.

---

<div class="post-metadata">

### Author: ![CaptainZac](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/captainzac/32/195184_2.png) [@CaptainZac](https://meta.discourse.org/u/CaptainZac)
#### Post date: [January 28, 2021, 1:00am UTC](https://meta.discourse.org/t/error-embedding/177504/3 "2021-01-28T01:00:25Z")

</div>

Thanks for the quick response!  
I just tried that and unfortunately get the same error with this:

 ![](https://global.discourse-cdn.com/meta/original/3X/1/0/106ae102a788d5bd7e6bf3bb50c78dec26d4a5e4.png)

---

<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: [January 28, 2021, 1:07am UTC](https://meta.discourse.org/t/error-embedding/177504/4 "2021-01-28T01:07:44Z")

</div>

Your `discourseEmbedUrl` is still set to the URL of a topic on your Discourse site. It looks to me like that is the topic that you are wanting to create on Discourse, but you need to set it to the canonical URL of blog post that you are adding the code to.

Have a look at this topic for details: [Embed Discourse comments on another website via Javascript](https://meta.discourse.org/t/embedding-discourse-comments-via-javascript/31963). Possibly what you are wanting to do is what is outlined in the [(Alternate Configuration) Linking to existing topics](https://meta.discourse.org/t/embedding-discourse-comments-via-javascript/31963#alternate-configuration-linking-to-existing-topics) section of that topic. In that case, you need to add a `topicId` parameter to the script. That parameter should be set to the `id` of the existing Discourse topic that you’d like to use.
