I am revisiting this issue as I still have not been able to resolve it and it is driving me crazy :-(.
Are there any nginx people that have experienced this?
We are running a focus item inside a campaign and it is not showing up as would be expected.
I am wondering if this might be a nginx configuration problem.
This is what I am seeing in the console
@robm and myself sat and debugged this issue and managed to get things working.
There are two issues here:
In the page visited Mautic is always expecting a trailing slash /
If you are running nginx and have used the configuration set out in linuxbabe article he is only allowing for 1.js to be passed through in the server rules:
Now my regex is not good enough to mess around with this so all I did was amend to this line the different focus items I wanted to allow to be served by the nginx server as follows:
Yes you can have focus items outside of a campaign, all you need to do is make sure you have inserted the code in the page you want it to load, or to do it via google tag manager.
A few points to keep in mind when testing:
Make sure you are not logged into Mautic when testing.
Make sure your CORS is enabled to the site you want to focus item to load.
if it is not loading are you seeing any errors in the the console or any logs ?
Off topic to your question, but on topic for this post I have an update on the config of nginx
Iām jumping in here because I think I have a similar problem.
Iām also currently testing the focus items in a campaign and Iām not getting any output on the page. If I include the focus item script it works without any problems.
I have defined a very simple campaign: Contact Segment ā Page Visit (with URL: *) ā Show Focus Item.
In the contact, the focus item is also given to me as āCampaign action triggeredā.
However, I donāt see anything on the page. Iām testing it locally in an incognito browser, have CORS turned off. I donāt see any errors in the console. The normal event is output in the network requests when the page is accessed.
Are you using the same browser for testing as admin? Remember: an admin gets an admin cookie, and tracking wonāt work. It means, that youāll never fulfill the āvisited pageā event.
Try to clear the cookies, and or use another browser for testing.
In my test case, however, it is not an anonymous contact but a segment with a group of specific contacts. So one of these contacts, Iām logged in incognito and unfortunately I donāt see the focus item.