Try the following:

  • Every time the condition is true > Go to page (Current page), [otp=1].
  • Add a condition for every time get data from page url, otp=1 > Show otp popup
  • Whenever user closes the popup > Go to page (Current page), [otp=empty].

This should be a work-around to your issue, understand that dynamic urls stay active even after refreshing, so even if you refresh the page with otp=1, the popup will show up without any user input. This can be easily mitigated with a "on load page, if get data from page url contains otp=1 > go to current page with otp=empty.