• Resolved pracko

    (@pracko)


    I was super excited to discover this plugin, but after trying to use it with my Mautic form, it doesn’t appear to work. I want to create a locked content page ‘Locked Page’ that requires an optin form on the page ‘Opt In’ to be completed first.

    On the ‘Opt In’ page I placed the [goal id=”nnn”] shortcode.

    On the ‘Locked Page’ I placed the [complete_goal id=”nnn”] shortcode and set the options in the B&A Metabox as follows: 1) Checked Enable Page Protection, 2) Chose the proper goal in the Require Visitors To Complete This Goal Before Viewing This Page dropdown, and 3) set the redirect field under Send users who have not completed the goal to this URL: to /opt-in/

    However, on submission of the form I simply remain on the ‘Opt In’ page and never get redirected to ‘Locked Page’.

    The issue may have to do with the fact that a Mautic form requires one of three actions on form submission (Successful Submit Action): 1) Remain at form, 2) Redirect URL, and 3) Display message. All three options have the same effect: I don’t get re-directed to ‘Locked Page’. Perhaps the Mautic form action and the B&A form actions are conflicting somehow?

    I thought maybe I was leaving out a ‘Thank You’ page in the middle (as the plugin instructions suggest). So I created a ‘Thank You’ page and inserted the [complete_goal id=”nnn”] shortcode there along with a button linking to the ‘Locked Page’. Then I set my Mautic form action to redirect to ‘Thank You’. Upon form submission, I was successfully redirected to the ‘Thank You’ page. However, anyone with the URL can simply visit that page and essentially “unlock” the ‘Locked Page’. Seems to defeat the whole purpose of the plugin.

    So I am kind of stumped here. Do I even need the ‘Thank You’ page? I’d prefer visitors to go straight from ‘Opt In’ to ‘Locked Page’. However, it seems that either the Mautic form action or Mautic’s javascript are conflicting with the B&A plugin.

    Any ideas?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor richardgabriel

    (@richardgabriel)

    Hey @pracko!

    I’m going to describe how you would use it with Ninja forms because I believe the steps should be the same, here. I’m not familiar with Mautic’s forms, but most forms support the needed options.

    0) Setup Goal NNN, with the After being a redirect to the Locked page.

    1) Create your form in Mautic forms. In the Success Message area of the form (text that is shown upon submission the form) add the [complete_goal NNN] shortcode.

    2) Create your Locked Page, with Page Protection turned on, Goal NNN as the required goal, and set the redirect if not complete option to the page with the Mautic Form.

    What should happen is a user should visit the locked page, not have the goal completed and therefore be redirected to the Form page. Then, when the Form is submitted and the success message shown, the Goal should be completed, the redirect fire, and the user see the Locked page.

    Since you do this as a Success Message instead of a Thank You page, there should be no way to trigger completion without filling out the form, first.

    Please note that Page Caching can interfere with Protected Pages.

    Can you try the above setup and let me know if it works on your system?

    All the best,
    Richard

    Thread Starter pracko

    (@pracko)

    Good suggestion Richard. I was hoping that would work, but what happens is that my [complete_goal NNN] is inserted at the top of the form (as a visible success message) upon form submit and no re-direction to the locked page takes place.

    I am using the Mautic plugin to insert the form as a shortcode in the Before section of the Goal. Perhaps I should try manually pasting the Mautic form code instead. I’ll report back.

    Thread Starter pracko

    (@pracko)

    So I manually pasted Mautic’s html form code into the before Goal (and also added the form’s required script into <head> of my page). That didn’t make a difference. The shortcode is still appearing as visible text above the form’s first name field as the ‘Success’ message. Looking at the page source code, it seems the shortcode/success message is being embedded within a div within the Mautic <form>. This is probably why the shortcode is being rendered as text rather than functioning as a shortcode (which should be invisible to the site visitor). Any other ideas?

    Plugin Contributor richardgabriel

    (@richardgabriel)

    Hey @pracko

    Ok, that’s too bad!

    The thank you page would definitely work, but as you’ve said if someone visits that page directly it will complete the goal for them (thus bypassing the form.) You could address this somewhat by making the page non-linked / indexed, so that people don’t discover it, and keep watch on the conversions to be sure. That isn’t ideal but would allow things to function.

    With something like Ninja Forms, shortcodes are rendered in the Success message so that this process works. It sounds like Mautic forms is not rendering shortcodes inside its content and so you have the problem you describe.

    You could write a PHP function that would link the two together. If there is a hook / action that is fired on Mautic forms when the form is submitted, you could attach a function to that that runs do_shortcode("[complete_goal NNN]"); when this particular form is submitted. That should achieve the same thing we are trying to above. Does that sound like something you can try?

    All the best,
    Richard

    Plugin Contributor richardgabriel

    (@richardgabriel)

    Hey!

    I believe the steps I’ve outlined above would take care of this issue, if you wanted to try them (or if anyone else who encounters this issue needs a way forward.)

    I’m going to go ahead and mark this topic as Resolved. If you need further assistance, please let me know!

    All the best,
    Richard

    Thread Starter pracko

    (@pracko)

    Hi Richard, sorry for my lack of follow-up. I had client projects and family stuff to deal with. I’ll see if I can’t get some info from the Mautic community on getting the shortcode to work properly in form success messages, try it out, and post my finding here. Cheers.

    Apologies for jumping in here, but I too was struggling to resolve looping back to the Ninja form on submit (as if goal was not completed).

    The plugin author’s recommended steps worked for me — with the key being — adding a success message to the Ninja form with the [complete_goal NNN] shortcode in the text area.

    Prior to adding the success message with shortcode, I only had a redirect message pointing to the protected page, so the goal was never recognized as completed, thus the loop. Also, I had incorrectly placed the [complete_goal NNN] shortcode on the protected page. It’s not needed there — only in the success message.

    Hope that helps ??

    • This reply was modified 7 years, 3 months ago by rrosenthal.
    • This reply was modified 7 years, 3 months ago by rrosenthal.
    Thread Starter pracko

    (@pracko)

    @rrosenthal, yes, that is correct. However, as I mentioned in my OP, anyone can share the URL to the success/thank you page which defeats the protection on the resulting page. This is why I was seeking to embed the [complete_goal NNN] shortcode within the Mautic success message instead as that can’t be accessed without entering an email address first.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Not working with Mautic forms’ is closed to new replies.