Onclick redirect


Please take a look here, to see how it works on a sample landing page.

As usual, you need to choose an element (or multiple elements) that is to be a trigger for redirection to another website. A “widget-redirect” class needs to be added to the selected widget:

Onclick redirect

Next, paste the below script to JavaScript Code bookmark, on the landing page dashboard. You also need to paste your URL to the code. Please notice, that there are two variants of the script.

This one opens the new URL in the same window, as your landing page:

 document.location.href = "https://google.com";

And here is a version that opens the new URL in a new window:

 window.open('https://google.com', '_blank');

In both cases, you need to paste your own URL instead of ‘https://google.com’ unless you actually want the users to go to Google 🙂

As always, feel free to modify the script if you want to. You can also use your own class names, as long as they are properly used in the jQuery selector.

Was this article helpful?

Can’t find what you need?

Let us help you!
Send us a message
We are using cookies for analytical purpose. Learn more.