Call focus item via button click

Your software
My Mautic version is: 3.3.2
My PHP version is: 7.4
My Database type and version is: 5.7

Your problem
My problem is: I’m trying to call a Mautic focus item via a button click on a home page (typo3).
Is this possible? How can I call the function via onclick event?

Steps I have tried to fix the problem:
I added the Mautic script:

<button type=“button” class=“btn btn-danger btn-lg” onclick="{mautic type=“focus” id=“2”}">Register

Thanks for your ideas

We had a similar idea just the other day and was not able to call it either, so interested to see if there is a solution here.

My Mautic version is: 3.3.3
My PHP version is: 7.4.19
My Database type and version is: PHP version: 7.3.27

I’m struggling with a similar issue. Basically, a 1 pager WP/Divi site and have an anchor set up as a custom menu item " #page". was thinking the trigger would be https://example/#page.

When to engage set to “upon arrival” at “0 sec”

but no luck so far

Hi @jtourgee are you able to get any pop ups ?

What is the script you using. I have found that the standard script generated is generally missing https at the begining and also index.Php after your base domain

Hey @taxi I am really not sure about how it is called or if I fully understood your reply. If you do get it to work I would be very interested to understand how as well

, I didn’t solve it, just kicked it down the rd for another time and went with static form instead. it would pop up but seemingly only randomly. I was also attempting multiple focus items on the same page for #section1,#section2 etc. they did not work as i’d hoped either. only one focus item would show up and not on the (CSSID#anchored) page jump. no doubt i’v gone beyond my coding paygrade…

1 Like

Hello,

after investigating again after quite a time, I found a kind of solution.

The script is included as suggested within the tags:

The button calls the function:

This calls the focus item.

Unfortunately it is only working if the focus item is set to:
When to engage?
Upon arrival

Timeout before engage
MUST be greater then 1 ore more integer sec.

How often to engage?
Every page

And here is the handicap.
I can’t just start the page without any focus item and trigger it only when the button is clicked.
The settings for the focus item have to be set as shown above.
For my page this is annoying because the focus item appears after 1 sec of loading and blocks the page from reading. This means, the visitor has to click the “x” to get rid of the focus item window, then read the page and if he clicks the button, the focus item appears again.

Ideal would be to trigger the focus item window regardless of the settings made with the focus item.

Any other suggestions or solutions are very welcome!

Kind regards

Christian

1 Like

Would it work with exit intent timing ? or only Upon arrival

First of all I say a BIG THANK YOU for the new release of Mautic! You’re doing such a great job! I love this tool!

In the new Mautic Version 4.2 I have seen the feature of adding scripts.

Landing Pages Script

It is now possible to add scripts to landing pages in the head or footer - for example tracking scripts, focus items and so forth.

Does this solve my issue calling a focus item via button click? Has anybody already tested this?

Kind regards

Christian

I still see no solution on triggering a focus item by a click of a button - I suppose this should be way much easier to trigger than the exit intent and all rest of triggers that are already available.
I did succeeded by using the elementor pro plugin - I use it already on my wordpress website.
Here is also a very short and clear tutorial: How Do I Create My First Popup? | Elementor
I added the form inside the popup the same way I integrate all the forms on my website: by adding a html-field and inside I paste the code from mautic-form. And there it is.
It is working like a charm :slight_smile:
Have a nice day !
Ionut

@taxi were you able to get the popup to open with a button click?

I tried to use an external popup plugin on my site for this but the form is not getting submitted.

What is the way out to get these pop ups to open? I want my popups to open when a visitor leaves site and when they click on a button on my site

I would request @ekke and @joeyk to help out with their valuable suggestions

hey @taxi, lets me help you.

First, you apply this jscript in head of your page. Change the url and the number os focus.

<script> 
src="https://code.jquery.com/jquery-2.2.4.min.js";
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
crossorigin="anonymous">
</script>

<script>
function OpenModal() {
$.getScript("//[mautic.meumautic.com.br/focus/1.js](http://mautic.meumautic.com.br/focus/1.js)"); }
</script>

And then, apply this code in button link

javascript:OpenModal();