# Get right title embedding comments

**URL:** https://meta.discourse.org/t/get-right-title-embedding-comments/140328
**Category:** Support
**Created:** [January 31, 2020, 6:13pm UTC](https://meta.discourse.org/t/get-right-title-embedding-comments/140328 "2020-01-31T18:13:26Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![pablogg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pablogg/32/164759_2.png) [@pablogg](https://meta.discourse.org/u/pablogg)
#### Post date: [January 31, 2020, 6:13pm UTC](https://meta.discourse.org/t/get-right-title-embedding-comments/140328/1 "2020-01-31T18:13:26Z")

</div>

Using the code to embedding comments always get the same title topic. # [Embedding Discourse Comments via Javascript](https://meta.discourse.org/t/embedding-discourse-comments-via-javascript/31963)

How could set the correct title for topic? How discourse get the topic title of a page? using the tag title of the head or other way?

Regards

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [January 31, 2020, 6:21pm UTC](https://meta.discourse.org/t/get-right-title-embedding-comments/140328/2 "2020-01-31T18:21:31Z")

</div>

Yes, page is parsed with Nokogiri and the title tag extracted.

Can you share a link of the article that was imported with the wrong title?

---

<div class="post-metadata">

### Author: ![pablogg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pablogg/32/164759_2.png) [@pablogg](https://meta.discourse.org/u/pablogg)
#### Post date: [January 31, 2020, 6:29pm UTC](https://meta.discourse.org/t/get-right-title-embedding-comments/140328/3 "2020-01-31T18:29:51Z")

</div>

I found that the problem is with my web page, because we use Vue and dynamic routes… and discourse only is getting the index one..

We have to fix it first.

Thanks! 😃

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [January 31, 2020, 6:43pm UTC](https://meta.discourse.org/t/get-right-title-embedding-comments/140328/4 "2020-01-31T18:43:21Z")

</div>

Our crawler, like most, doesn’t execute Javascript.

Your options would be to either:

- Add some sort of SSR. Either locally or with some tool like [https://www.prerender.cloud/](https://www.prerender.cloud/)

- Change Discourse integration from the JS method, to one where you call our API and create the topics with it, having full control over the content. After that, you can use the same JS comments component but pass the pre-created topic ID so it will link the two.

---

<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: [December 22, 2023, 5:06am UTC](https://meta.discourse.org/t/get-right-title-embedding-comments/140328/5 "2023-12-22T05:06:25Z")

</div>


