Pop-Ups trigger on query string.
For the Elementor Pop-Up, is it possible to trigger the pop-up? For example via a query string like: /?coupon-code
I've tried using the Advanced Rules -> When arriving from specific URL (Regex): (.*)?convention-coupon But that doesn't seem to work, anyone has any clue to how I would state that if they are on a page where there is a part of the URL query matching that the pop-up would trigger?
Thanks in advance for further information.
Hi @RafaelDeJongh
Triggering and printing a popup using a URL parameter poses a potential security breach because every user can use this query to show hidden popups on demand.
A different approach we will consider is adding the option to trigger a popup while it is already printed to the page (based on the conditions you set).
Currently, this feature is not supported, but we will look into it in the future if we see a large demand for it.
Thanks for the feedback.
Hmm I see, for me it would be handy for let's say if I make a specific popup that can be triggered side wide and is only shown with the correct query string AND value so for example we do the popups to provide specific discounts for our store when we are at a convention.
In other words if the user scans a QR code they will get a unique link that refers to ?convention-coupon=TomoFair, only then it would trigger that specific pop up.
I personally do not directly see a potentional security breach with that other than brute forcing the way to see what pop ups would work, but then again having a specific date/time that it could appear would be very potentional as the coupon would only work for let's say 2 weeks after the convention has passed and thus becomes invalid if the user potentionally brute forced its way in finding a popup trigger.
I am not really sure what other situations could happen from this, but as I would require this feature in--rather soon (next Saturday actually) I was wondering if there is another way to activate a popup based on a user action when the user has scanned the code comes to the site and specifically opens up that pop up.
I also noticed that the Dynamic field for text and such doesn't seem to work with pop-ups, or at least not on the animated text (the part that is actually animated has no option to use a dynamic field based on the query string) which in this case could be very handy as we could use the same pop-up template for coupons and would just need to change the url query rather than change the template each time.
So any suggestions towards this would be welcome, or if you have any alternatives to this what a other good way would be to get this sorted, let me know. As said I would need a solution before Saturday, it doesn't require to be a popup so any alternative idea is welcomed!
Thanks for the fast reply!
+1 Would really love to see that.
+1 Here as well. The regex option is a bit limited and not user-friendly.
You could write a simple JS query to look if the parameter is in the url and then trigger the popup like this:
elementorProFrontend.modules.popup.showPopup( {id:xxxx}, event);
Just change the xxxx id to your popup
+1 I need this feature!
+1
+1
Is this Regex option a true regular expression? Or is it just a simple * pattern matching?
For example would the following RegEx work: .*-[cp][0-9]+$ to match anything ending with a dash a 'c' or 'p' ending with digits between zero and nine. As the regex does above?
Essentially is Elementor popup using the javascript regular expression matching engine or not?
Something like:
var replace = "My Regular Express";
var re = new RegExp(replace,"g");
Thanks
So dumb and such appatty from devs.
Workaround is to hide a link that triggers the popup, then check the location.href with JS and then call a click() event on the hidden link
if(window.location.href.indexOf('foo_bar')>0)
$('.baz a').click()
Hi @RafaelDeJongh
Triggering and printing a popup using a URL parameter poses a potential security breach because every user can use this query to show hidden popups on demand.
A different approach we will consider is adding the option to trigger a popup while it is already printed to the page (based on the conditions you set).
Currently, this feature is not supported, but we will look into it in the future if we see a large demand for it.
Thanks for the feedback.
Come on man Really need this to work
You could write a simple JS query to look if the parameter is in the url and then trigger the popup like this:
elementorProFrontend.modules.popup.showPopup( {id:xxxx}, event);
Just change the xxxx id to your popup
From the other suggestions, yours seems like the best to add a bandaid on until elementor finds a way to fix it themselves.
Triggering and printing a popup using a URL parameter poses a potential security breach because every user can use this query to show hidden popups on demand.
I don't agree with this, at all. If implemented correctly, there is no additional risked compared to activating pop-ups with any other trigger. You could just add a trigger "url parameter" where the developer could set a keyword. If the person building the site doesn't understand the consequences of enabling this, they should not be building websites in the first place.
This is an important feature and shouldn't be treated like a potential security breach. Opening popups isn't a security concern. If you open a popup with confidential information then the security issue lies in the fact, that you have confidential information in a popup in the first place. For my use case, I need the popup after a redirect - which happens to add a certain parameter. Only those users with the URL parameter need the popup. So again, this is not a feature that has any relation to security. It is a simple function.
Want this feature as well...
Would love this feature as wel :)
+1
+1 No security breach there. Would be EXTREMELY useful for ad campaigns and targeted promos.
+1
Triggering and printing a popup using a URL parameter poses a potential security breach because every user can use this query to show hidden popups on demand. - that's so dumb...
- 1 to have the ability without external js workaround
You could write a simple JS query to look if the parameter is in the url and then trigger the popup like this:
elementorProFrontend.modules.popup.showPopup( {id:xxxx}, event);
Just change the xxxx id to your popup
This code works only we are login as admin.. Not working for Guest users
@nicholaszein Do you plan to implement this option? It is essential to have it. Thanks
+1 for this feature
+1 I am pretty sure, it's so hard for the devs to find a way to implement this feature.