elementor icon indicating copy to clipboard operation
elementor copied to clipboard

Pop-Ups trigger on query string.

Open RafaelDeJongh opened this issue 7 years ago • 24 comments

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.

RafaelDeJongh avatar Feb 19 '19 02:02 RafaelDeJongh

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.

shilo-ey avatar Feb 19 '19 07:02 shilo-ey

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!

RafaelDeJongh avatar Feb 19 '19 08:02 RafaelDeJongh

+1 Would really love to see that.

bentalgad avatar May 07 '19 15:05 bentalgad

+1 Here as well. The regex option is a bit limited and not user-friendly.

digitalinksol avatar Sep 11 '19 01:09 digitalinksol

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

aleksifa avatar Feb 15 '20 09:02 aleksifa

+1 I need this feature!

sfburton avatar Feb 28 '20 00:02 sfburton

+1

jacobgorthy avatar Mar 07 '20 19:03 jacobgorthy

+1

Sedim avatar Apr 14 '20 04:04 Sedim

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

Oldnate avatar May 06 '20 17:05 Oldnate

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()

Nodws avatar Jul 22 '20 17:07 Nodws

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

semiexperienced avatar Nov 14 '20 22:11 semiexperienced

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.

RafaelDeJongh avatar Nov 15 '20 06:11 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.

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.

tnagels avatar Nov 30 '20 18:11 tnagels

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.

mischa2002k2 avatar Apr 08 '21 05:04 mischa2002k2

Want this feature as well...

t-bo avatar Aug 25 '21 13:08 t-bo

Would love this feature as wel :)

sariyanta avatar Nov 09 '21 13:11 sariyanta

+1

WallnerK avatar Nov 23 '21 13:11 WallnerK

+1 No security breach there. Would be EXTREMELY useful for ad campaigns and targeted promos.

TheCosmonaut avatar Jan 15 '22 17:01 TheCosmonaut

+1

goodlookingout avatar Jun 07 '22 04:06 goodlookingout

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

Leadsquad avatar Apr 24 '23 17:04 Leadsquad

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

newworldlife1 avatar May 05 '23 15:05 newworldlife1

@nicholaszein Do you plan to implement this option? It is essential to have it. Thanks

acornavi avatar May 22 '23 10:05 acornavi

+1 for this feature

dave-gil avatar May 25 '23 17:05 dave-gil

+1 I am pretty sure, it's so hard for the devs to find a way to implement this feature.

engrrajonahmed avatar May 11 '24 06:05 engrrajonahmed