Convert Plus modal opening on page load of a specified link not working

Hi there, first of all great job, thanks!

My issue: I need, as a target marketing action, to land on the website and show a modal already opened, depending on the url (several urls, several modals, eg.: mywebsite.com/#/link1 - mywebsite.com/#/link2). I have created the class for the manual opening of the Convert Plus modal (eg.: .modal-one-open for the first modal, .modal-two-open for the second).

Then I did the work through javascript to simulate the click on the specified element as it follow:

jQuery(document).on(‘ready’, function() {
var url = document.location.href;
var command = url.split(’#’)[1];
if(command == ‘/link1’) {
jQuery(’.modal-one-open’).click();
} else if(command == ‘/link2’) {
jQuery(’.modal-two-open’).click();
}
});

With Convert Plus this is not working. I tried another plugin (Popup Maker) that was accomplishing with my needs, but was breaking the theme content creation and created conflicts with other plugins such as E&P form builder.

Would be so kind of you to suggest a solution in order to use Convert Plus for my purpose, or in case should be impossible, to check for the conflicts generated by the use of Popup Maker.
Thanks in advance for your attention, hope to hear from you soon
Giorgio from Emergento

Hey Giorgio,

Regretfully, we cannot provide support for third party plugins or scripts due to the fact that there is simply no way to account for all of the potential variables at play when using another developer’s plugin or script. Because of this, any questions you have regarding setup, integration, or troubleshooting any piece of functionality that is not native to X will need to be directed to the original developer.

Thank you for your understanding.

Hi there, I understand your point but to ask for support to the Convert Plus team in their submit-a-ticket-form they’re asking for a purchase key that obviously I don’t have. How can I manage this? Could you provide a code I can insert in their form in order to complete my request?
Thanks again, cheers
Giorgio

Hi Giorgio,

Can you provide us your site url so we can take a closer look.

Thanks

Hi there, we’re on dev mode so the link is the following:

Summary

http://wordpress-137568-398309.cloudwaysapps.com/
actually it should work adding /#/linkgio at the end of the link to show the modal (but not working)

Anyway I wanted also to ask about the modals included in the X theme. I can add a modal through cornerstone as part of the content in a page, there’s a way to add a modal at “entire website” level? Because I tried using X modals too and is working (through javascript I can easily simulate a click on the toggle button), but this is working only in the page in which the modal is inserted of course :slight_smile:
Thanks again in taking care of my request,
Giorgio

Hi there,

Unfortunately, you can not add the class in question with Javascript as the detection of the ConvertPlus is happening before your code adds the class.

I suggest that you install the Duplicate Post plugin and clone the landing page and assign each with the specific ConvertPlus modal which you have created.

By the way, if you use the Smart Launch function of the ConvertPlus which will add the modal for all pages of the website:

Thank you.

Hi again,
sorry for being ripetitive, but I’m not adding a class through my javascript, the class is the one you can assign when creating the Convert Plus modal in order to get a trigger element, so the class already exists when the convert plus is happening (in the following example i added the class “modal-test-launch” , in my jQuery example above were called “modal-one-open” and “modal-two-open” but are the same stuff):

My javascript is only looking for the presence of a string text and clicking on that class.

Also, duplicating post is not resolving my issue, because the “link1” or “link2” are not referred to a landing page, but just a string needed in order to be recognized by my javascript to show the modal.
As an example:
www.mywebsite.com/page-one/#/link1 and www.mywebsite.com/page-two/#/link1
will open two different pages (/page-one and /page-two) but my javascript will read the address and recognize (after the “#” symbol) the presence of some text (in this case “link1” but could be “anyword”) in order to show the modal.

The third suggestion obviously is not useful in my case, as it will show the modal “after few sec” ALWAYS and NOT depending on the presence in the address of my string.

I repeat, I’m sorry and don’t want to be any annoying, just trying to find a solution to my case and discussing it with you as I cannot discuss with the CP plugin developers and cannot use other plugins because of their incompatibility with X.

Any other idea would be appreciated, even if I understand could be possible not to receive any other answer from you :slight_smile:

Thanks for your attempts til now,
Giorgio

Hello There,

I’ve taken a closer look at your code and it seems incorrect. Please have it updated and use this instead:

jQuery(document).on('ready', function() {
	var url = document.location.href;
	var command = url.split('#')[1];
	if(command == 'link1') {
		jQuery('.modal-one-open').click();
	} else if(command == 'link2') {
		jQuery('.modal-two-open').click(); 
	}
});

You will have to make sure that the modals has been loaded in the page, hidden waiting to be triggered. You can ensure it by setting that the modal is visible in all pages.

Hope this helps. Please let us know how it goes.

Hi again,
Thanks for the reply but it was not the problem (because as I told at the beginning my code was working with other modal plugins).
Anyway I solved my issue changing the method, instead of …(document).on(‘ready’… I used …(window).on(‘load’…
and well, that’s solving in a different way my problem :slight_smile:
Thanks anyway for the support, cheers
Giorgio

You’re welcome. Glad you’ve sorted your issue.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.