Your software
My Mautic version is: 4.1.1
My PHP version is: 7.4
My Database type and version is: Mysql 8
Your problem
My problem is:
Hello everyone,
I’m using Dynamic web content with Email-> Empty filter to show the focus only to anonymous people.
Dynamic web content is not loading for the first page load, but it loads every time after refresh
or a page change.
I would like to make it work the first time page load.
At these points Mautic seems to first check the user and then save the row on the DB, so the second time it finds the row and verifies that it does not have the mail and the focus appears, but in this way I lose hundreds of OnSite views because Mautic does not understand the first time you are an anonymous.
Well here is the thing:
First you load the dynamic content and THEN you create the contact.
This way the first time you load, there will be no track of this person and the dynamic content cannot be loaded, since there is noone to load for.
I think your issue is that the DWC tries to appear too fast. Mautic is simply not ready with the contact. A person more skilled in Javascript could show you how to display the html after 2-3 seconds. So much would be enough.
Well, your issue is not ‘not to intercept’ but more like ‘Intercept, save, display, callback, make desision and push content.’ Within the runtime of the script.
On the other hand I 100% agree. It should be like ‘if there is no cookie yet, show this’
We checked mtc.js and found the function that processes the DWC then double check on the onload to verify that the default content has been replaced by focus (of course, as we reported the first time, it never passes and the onload fix the problem), in this way double calls are not created on subsequent visits where Mautic has already identified us.