# Can mautic dwc show up on external webpages

**URL:** <https://forum.mautic.org/t/can-mautic-dwc-show-up-on-external-webpages/24581>\
**Category:** Development\
**Tags:** development\
**Created:** [June 24, 2022, 1:57pm UTC](https://forum.mautic.org/t/can-mautic-dwc-show-up-on-external-webpages/24581 "2022-06-24T13:57:22Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarssysar](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sarssysar/32/6499_2.png) [@sarssysar](https://forum.mautic.org/u/sarssysar)\
**Post date:** [June 24, 2022, 1:57pm UTC](https://forum.mautic.org/t/can-mautic-dwc-show-up-on-external-webpages/24581/1 "2022-06-24T13:57:22Z")

</div>

Hi, can mautic dwc show up on external webpages? I’m testing a mautic campaign and it works when my form redirects to a mautic landing page, but not when it directs to an external html page. I have a picture included of my html code with the mautic tracking object and dwc slot called.

 ![Screen Shot 2022-06-23 at 11.06.14 AM](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/8/81b5095ec63fdda8188ae1d0e255cf5161e5ebc9.jpeg)

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [June 27, 2022, 8:28am UTC](https://forum.mautic.org/t/can-mautic-dwc-show-up-on-external-webpages/24581/2 "2022-06-27T08:28:55Z")

</div>

Hi, yes, it would work.  
you need 2+2 ingredients to make it work:

2 Obvious ingredients:

1. Mautic tracking code on that page (I can see it’s done)
2. DWC code included (it’s also done)

+2 secret ingredients:

1. You need to make sure you don’t have CORS issue. This happens, if your server is [m.mautic.com](http://m.mautic.com) and your external page is [whatever.com](http://whatever.com). If [whatever.com](http://whatever.com) is might be set in a way that all external scripts are blocked. You can see an error in the browser javascript console. (Something like CORS blabla error blaba not permitted.) You should have HTTPS on both sites.

2. You need to test this with a browser, where you never logged in as admin into Mautic. Incognito might not be enough. The reason is, if you have logged in as admin before, then you have the admin cookie and DWC is not shown to you.

---

<div class="post-metadata">

**Author:** ![sarssysar](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sarssysar/32/6499_2.png) [@sarssysar](https://forum.mautic.org/u/sarssysar)\
**Post date:** [June 29, 2022, 3:06pm UTC](https://forum.mautic.org/t/can-mautic-dwc-show-up-on-external-webpages/24581/3 "2022-06-29T15:06:46Z")

</div>

Hi, thank you for your reply but I’m still having problems.  
I’ve confirmed that both sub domains are on the same domain and I’ve also tested on multiple browsers that have not been logged in to Mautic.  
The sites were on different domains but are on the same one now, could that be the problem?

here’s the code for the form page:

```auto
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script>
    (function(w,d,t,u,n,a,m){w['MauticTrackingObject']=n;
        w[n]=w[n]||function(){(w[n].q=w[n].q||[]).push(arguments)},a=d.createElement(t),
        m=d.getElementsByTagName(t)[0];a.async=1;a.src=u;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://[subdomain]/mtc.js','mt');

    mt('send', 'pageview');
</script>
</head>
<body>

    <script type="text/javascript" src="//[subdomain]/form/generate.js?id=3"></script>

</body>
</html>

```

---

<div class="post-metadata">

**Author:** ![techbill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/techbill/32/8325_2.png) [@techbill](https://forum.mautic.org/u/techbill)\
**Post date:** [June 29, 2022, 3:16pm UTC](https://forum.mautic.org/t/can-mautic-dwc-show-up-on-external-webpages/24581/4 "2022-06-29T15:16:05Z")

</div>

Have you confirmed you are not having CORS issue?

Look in the browser console for any error or if you are having CORS issue.

---

<div class="post-metadata">

**Author:** ![sarssysar](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sarssysar/32/6499_2.png) [@sarssysar](https://forum.mautic.org/u/sarssysar)\
**Post date:** [June 29, 2022, 3:19pm UTC](https://forum.mautic.org/t/can-mautic-dwc-show-up-on-external-webpages/24581/5 "2022-06-29T15:19:40Z")

</div>

Hi. No, there’s no CORS issue either.

---

<div class="post-metadata">

**Author:** ![techbill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/techbill/32/8325_2.png) [@techbill](https://forum.mautic.org/u/techbill)\
**Post date:** [June 29, 2022, 3:23pm UTC](https://forum.mautic.org/t/can-mautic-dwc-show-up-on-external-webpages/24581/6 "2022-06-29T15:23:53Z")

</div>

I don’t know if it will make any difference but my Mautic tracking script is inside the `body` tag which works for me.

I noticed that yours is inside the `head` tag, try moving it inside the `body` tag and see if that fixes it.

---

<div class="post-metadata">

**Author:** ![sarssysar](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sarssysar/32/6499_2.png) [@sarssysar](https://forum.mautic.org/u/sarssysar)\
**Post date:** [June 29, 2022, 10:47pm UTC](https://forum.mautic.org/t/can-mautic-dwc-show-up-on-external-webpages/24581/7 "2022-06-29T22:47:52Z")

</div>

Moving the mautic script to the body did not fix the issue either.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [June 30, 2022, 6:09am UTC](https://forum.mautic.org/t/can-mautic-dwc-show-up-on-external-webpages/24581/8 "2022-06-30T06:09:26Z")

</div>

Do you have any error in console?

---

<div class="post-metadata">

**Author:** ![sarssysar](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sarssysar/32/6499_2.png) [@sarssysar](https://forum.mautic.org/u/sarssysar)\
**Post date:** [June 30, 2022, 3:38pm UTC](https://forum.mautic.org/t/can-mautic-dwc-show-up-on-external-webpages/24581/9 "2022-06-30T15:38:25Z")

</div>

ah, yes I do.

 ![Screen Shot 2022-06-30 at 8.17.43 AM](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/a/a3bb42f909240adfd51099369b7bd89c1e381a42.png)

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [July 1, 2022, 7:04am UTC](https://forum.mautic.org/t/can-mautic-dwc-show-up-on-external-webpages/24581/10 "2022-07-01T07:04:13Z")

</div>

These are not related, just the regular Onesignal problem

---

<div class="post-metadata">

**Author:** ![yukzanaly](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yukzanaly/32/1769_2.png) [@yukzanaly](https://forum.mautic.org/u/yukzanaly)\
**Post date:** [July 1, 2022, 11:27am UTC](https://forum.mautic.org/t/can-mautic-dwc-show-up-on-external-webpages/24581/11 "2022-07-01T11:27:20Z")

</div>

This’s is how I do mautic dynamic content on WordPress pages

```auto
<div data-slot="dwc" data-param-slot-name="myslotname">
  <h3>Header text</h3>
  <p>paragraph text</p>
  <script type="text/javascript" src="//mymautic.com/form/generate.js?id=7"></script>
</div>

```

worth to check your CORS. don’t end your domain with slash ( / )

hope this works

---

<div class="post-metadata">

**Author:** ![sarssysar](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sarssysar/32/6499_2.png) [@sarssysar](https://forum.mautic.org/u/sarssysar)\
**Post date:** [July 6, 2022, 2:45pm UTC](https://forum.mautic.org/t/can-mautic-dwc-show-up-on-external-webpages/24581/12 "2022-07-06T14:45:55Z")

</div>

Hi, moving the script below the

element didn’t help. And there’s still no CORS issue.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [July 6, 2022, 3:39pm UTC](https://forum.mautic.org/t/can-mautic-dwc-show-up-on-external-webpages/24581/13 "2022-07-06T15:39:12Z")

</div>

Can you plz share this screen?

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/0/0ed87f089e5a28686125b1f0681fa27b85811a05.png)

---

<div class="post-metadata">

**Author:** ![sarssysar](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sarssysar/32/6499_2.png) [@sarssysar](https://forum.mautic.org/u/sarssysar)\
**Post date:** [July 7, 2022, 9:03pm UTC](https://forum.mautic.org/t/can-mautic-dwc-show-up-on-external-webpages/24581/14 "2022-07-07T21:03:06Z")

</div>

![Screen Shot 2022-07-07 at 4.01.53 PM](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/0/0602355d99a26e9582c23ad2672b0f6378f85f51.png)

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [July 10, 2022, 6:53am UTC](https://forum.mautic.org/t/can-mautic-dwc-show-up-on-external-webpages/24581/15 "2022-07-10T06:53:44Z")

</div>

Hi,  
You are using campaign based dwc, not filter based. (See switch “Is campaign based?”)  
As a result you don’t have a slot name. The DWC will be shown as a campaign step (ONCE), what you have to add in the campaign editor.  
Is this what you want?  
Joey
