Mautic Community Forums

Focus item not shown

Hello, guys



Please help.




Embedded into site footer...so it should be shown on every page...but NOT

Can't understand the issue...

Help!

https://finmodelslab.com/

Hello, guys

Please help.

Embedded into site footer…so it should be shown on every page…but NOT

Can’t understand the issue…

Help!

https://finmodelslab.com/

I have exactly the same problem.

You need to add the full URL to the script on your page, currently, you have this:

<script src="3.js" charset="utf-8" type='text/javascript'></script>

Which will work from the homepage, but as soon as you move to say the blog, the URL to load the script changes to:

/blog/3.js but you should be loading it as:

<script src="//finmodelslab.com/3.js" charset="utf-8" type='text/javascript'></script>

Update your code and try again.

I hope this helps.

Derek

@DerekBuntin
In my case I’ve copied the code Mautic gives back in the Focus Items screen. It’s this one

<script src="//leermij.e1.al/focus/1.js" type="text/javascript" charset="utf-8" async="async">

It does show up in the html of the website, alas no focus item is shown.

So with your previous update I changed it to:

<script src="//leermij.e1.al/focus/1.js" type="text/javascript" charset="utf-8">

Again, it shows up like it should, but the focus item is not shown on the website.
( https://leermij.nu )

What seems to be the problem here then? Any ideas?

@senol you have a script issue:

Refused to execute script from 'https://leermij.e1.al/focus/1.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

You might want to check with your host about the script being served as text/html.
I hope this helps.
Derek

Got this:

[quote]By adding a callback argument, you are telling jQuery that you want to make a request for JSONP using a script element instead of a request for JSON using XMLHttpRequest.

JSONP is not JSON. It is a JavaScript program.

Change your server so it outputs the right MIME type for JSONP which is application/javascript.

(While you are at it, stop telling jQuery that you are expecting JSON as that is contradictory: dataType: ‘jsonp’).
[/quote]

This is a MIME problem in Mautic. Not in wordpress.
Also Slack has a discussion about this, but it’s not really solved. The problem still persist.
I’m out of ideas on where to look next or how to solve it (as I am also not a developper).

It’s the server that serves the script’s and your site works fine on the first page, it was only when I went to an internal page that the issue started.

Have you asked your host about the issue?

@DerekBuntin do you mean the host of Mautic or the host of my website?

Both really, the thing is the script is being served up at your main domain so it’s that server that will be deciding what type of document is to be served, it could be a security option with your server so I’d reach out to your hosting service and ask them to investigate it. You need to ensure you tell them that the script works on your homepage, which tells me Mautic is working fine but something is determining its MIME type on deeper links on your site and that’s likely due to the server.

Let me know how you get on.

Derek

@DerekBuntin
sorry :slight_smile:
but I’m really not sure what to ask… I had the distinct feeling I did… But the website hosting said go to the place where mautic is hosted… but there I’m pointed into the direction of my wordpress website…
it’s from pilar to post … so it seems…

perhaps I should stop using Focus Items forms now… and come back to it in a few weeks or months…

Hi @senol,

Who is your host?
Where is Mautic installed, is it on your own hosting platform with your website or is it on the Mautic servers?

It is difficult to debug when you don’t have access to your site and of course understanding what plugins you’re using.

Are all other scripts are working on your site?

Do you have any security plugins installed on your WP site?

Have you setup CORS in the config?

Thanks
Derek

@DerekBuntin
Mautic is installed on a Amazon server with SES.
My website is here in the Netherlands

Other scripts are working fine.
CORS are set to :
https://leermij.nu
https://www.leermij.nu
http://leermij.nu
http://www.leermij.nu

(I thought let’s put them all in).

The WP Mautic plugin is working, because I can get the other forms working on the website.

I do not believe I have any other security plugin running on the website.

Try putting the following code into your htaccess file:

<IfModule mod_headers.c> Header always set X-Content-Type-Options nosniff </IfModule>

Let me know what the results are.

Derek

I’ve stopped using Focus Items.
We’ve got it working (showing in firefox and chrome) when I was on different location+computer.

At home I couldn’t get the focus item to show again. Cleared cache, new browser, incognito, even started up a private acces vpn to get a different ip. Nothing happens.

Also: the focus item was "ugly as hell :slight_smile: "
so… I think I’m gonna invest in Thrive Leads to get focus items covered. But it’s a shame nonetheless.