# Random topic creation by Facebook?

**URL:** https://meta.discourse.org/t/random-topic-creation-by-facebook/113938
**Category:** Support
**Created:** [April 10, 2019, 9:07am UTC](https://meta.discourse.org/t/random-topic-creation-by-facebook/113938 "2019-04-10T09:07:30Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![netpositive](https://avatars.discourse-cdn.com/v4/letter/n/8edcca/32.png) [@netpositive](https://meta.discourse.org/u/netpositive)
#### Post date: [April 10, 2019, 9:07am UTC](https://meta.discourse.org/t/random-topic-creation-by-facebook/113938/1 "2019-04-10T09:07:30Z")

</div>

Hello,

the comments are provided by Discourse on our custom blog. Everytime when a new post is shared on the Facebook the user visits from FB URL (the valid URL of the post + fbclid variable) randomly create topics in Discourse like when a new post is created on the blog. They’re actually created by the admin user as normally, but the post URL contains the FB variable mentioned above. When somebody clicks on that link then it takes to the blog post but the Discourse comment section doesn’t show up.

It’s pretty annoying because if a post gets more views then it pollutes the forum with “fake”/duplicate topics.

I’m pretty clueless with this problem 😟 Any thoughts?

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [April 10, 2019, 2:06pm UTC](https://meta.discourse.org/t/random-topic-creation-by-facebook/113938/2 "2019-04-10T14:06:16Z")

</div>

You should set correct page URL for `discourseEmbedUrl` in the comments script. You shouldn’t blindly pass current browser URL as the value.

---

<div class="post-metadata">

### Author: ![netpositive](https://avatars.discourse-cdn.com/v4/letter/n/8edcca/32.png) [@netpositive](https://meta.discourse.org/u/netpositive)
#### Post date: [April 10, 2019, 2:19pm UTC](https://meta.discourse.org/t/random-topic-creation-by-facebook/113938/3 "2019-04-10T14:19:08Z")

</div>

The `discourseEmbedUrl` is properly set on the blog pages. The problematic URL look like `http://example.com/blog/post/?fbclid=uFCrBkUgEvKg...`

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [April 10, 2019, 2:31pm UTC](https://meta.discourse.org/t/random-topic-creation-by-facebook/113938/4 "2019-04-10T14:31:23Z")

</div>

It shouldn’t include query string in `discourseEmbedUrl` property. You should do something like below

> [@discourseEmbedUrl and Joomla](https://meta.discourse.org/t/discourseembedurl-and-joomla/92039/2):
>
> `discourseEmbedUrl: window.location.href.split(/[?#]/)[0] };`

---

<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: [September 11, 2019, 9:53am UTC](https://meta.discourse.org/t/random-topic-creation-by-facebook/113938/5 "2019-09-11T09:53:43Z")

</div>

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