My form doesn't pop up if you've navigated to a different page

  • discoverdelicious
    Asked on October 25, 2016 at 5:43 AM

    Hi there.

    I have a newsletter pop up on my blog. I have two custom pieces of code injection which you guys helped me out with before. One of them is a lightbox delay so that the form pops up after 20 seconds. The second is a check cookie script that makes sure the form doesn't pop up again on another page if you've already dismissed it.

    I think that one of these codes is possibly the problem? Because at the moment, for example, if a user browses the site for 10 seconds (less than the delay time), and then navigates to another page, the form will never pop up even after 20 seconds meaning they don't see the form at all. I think this is costing me a fair bit of newsletter sign ups.

    Can you help me?

    Thanks,

    Michael

  • omerorkun JotForm Data Scientist
    Replied on October 25, 2016 at 8:06 AM

    Hi Michael,

    On your code, there is a line under the Script tab:

    <script src="https://form.jotform.com/static/feedback2.js?3.3.REV" type="text/javascript">

    Please crop the first checkCookie function just under this line. And paste the function in the lightbox delay script, where the pop up is delayed. You should paste it here:

    var delayseconds = 15;

        function pause() {

        myTimer = setTimeout('whatToDo()', delayseconds * 1000)

        }

       function whatToDo() {

    document.getElementById('lightboxdelay').click();

      checkCookie();

        }

    window.onload = pause;

     

    To the place that I highlighted with yellow. Please try this and see if the issue still persists. We will be waiting for your response.

    Thank you for contacting us. 

     

  • discoverdelicious
    Replied on October 25, 2016 at 10:41 AM

    Hi there.

    Thanks for your reply. Sorry I'm a litte confused which lines to cut and paste. Do you mean the whole bit beneath checkCookie()? I.e. lines 4-79? Or just the first function, called setCookie: lines 6-8?

    Michael

  • omerorkun JotForm Data Scientist
    Replied on October 25, 2016 at 10:44 AM

    Hi Michael,

    You should only cut the checkCookie(); function, which is highlighted with yellow background on my response. That lies just under the line

    <script src="https://form.jotform.com/static/feedback2.js?3.3.REV" type="text/javascript">

    on your code.

    That is also what you should paste to the related area that I addressed above. 

    We will be waiting for your response upon trying this. 

  • discoverdelicious
    Replied on October 25, 2016 at 10:52 AM

    As in just cut that one line, "checkCookie();" and put it where you said? So effectively calling the function in a different place? Sorry if I am misunderstanding.

  • Boris
    Replied on October 25, 2016 at 12:45 PM

    Yes, that is correct. I see you have already performed the steps suggested by our colleague.

    Please let us know should you experience any further problems with this script. Thank you.

  • discoverdelicious
    Replied on October 25, 2016 at 1:38 PM

    Ok so i've implemented the script and unfortunately the form doesn't show up at all now.

  • Kevin Support Team Lead
    Replied on October 25, 2016 at 4:33 PM

    I have checked your website and I can see nothing is showing up when you first load the webpage; I have copied the code you're currently using in your webpage and seems like it does not work, but unfortunately I could not find why may be causing the problem  since there is not anything displayed in the web console that may indicate what could cause the issue. 

    What I would suggest you is to set the code as it was before, when it worked so we can further check and work over that code. 

    We'll wait for your response. 

  • discoverdelicious
    Replied on October 26, 2016 at 6:43 AM

    Ok, I've changed the code back to how it was now, and I've checked and the form has started to pop up again.

  • omerorkun JotForm Data Scientist
    Replied on October 26, 2016 at 9:36 AM

    Hi Michael,

    Firstly I am sorry for the inconvenience that is caused on my behalf. Please accept my apology that the initial thought that I had in mind did not work. 

    I have now loaded your form. After 3 or 4 seconds I navigated to a different tab on my browser. No matter how much time I spend on that particular tab your form pops-up successfully which is what you desire, I guess. See it yourself here:

    My form doesnt pop up if youve navigated to a different page Image 1 Screenshot 20

    Can you please confirm that it is also working on your end? Because everything seems to be working fine here.

    We will be waiting for your response. 

  • discoverdelicious
    Replied on October 26, 2016 at 11:00 AM

    That's ok, I accept your apology!

    Ah I now see why you perhaps were confused, what I meant was once you navigate to a different page on the site (as opposed to a different web browser tab) before the form has popped up, it will not subsequently appear. Do you see what I mean?

  • Boris
    Replied on October 26, 2016 at 12:18 PM

    Thank you for the clarifications. If I understood your last message correctly, the problem only occurs if you load another page of your own site, inside that same browser tab, before the form had time to pop up.

    I have checked your site, in a Private / Incognito window, and the popup still appeared correctly even if I navigated to another page of your site. Please see the following screen recording of the test:

    My form doesnt pop up if youve navigated to a different page Image 1 Screenshot 20

    I have made several such tests, even with opening multiple different pages, but once I've stayed long enough on one page so it can show me the popup, the popup appeared correctly.

    Please try checking this on a different browser, preferably in Private / Incognito mode so that your existing cookies are not being read. From what I'm seeing on your website and based on your descriptions, the popups appear to be functioning fine at the moment.

  • discoverdelicious
    Replied on October 28, 2016 at 4:22 AM

    Hi there, I thought my reply had gone through to this, but apparently not. Sorry if you receive this response twice.

    Yes, you've understood my problem perfectly. The thing is, it seems that your test (from a recipe page for a few seconds --> homepage) the form works fine. However may I encourage you to try it the other way round? So if you load the homepage and then, before the form has had time to pop up, click a recipe? Do you experience the same problem I do?

  • omerorkun JotForm Data Scientist
    Replied on October 28, 2016 at 4:44 AM

    Hi Michael,

    I have reproduced the issue upon your description. When I load your website and click a recipe afterwards, your form never pops-up. 

    Please allow me some time to find out how to configure your coding to resolve this issue. Thank you so much for your detailed description. And please accept my apology that it took this long to understand your issue for me. 

    I am hoping to send a response in a timely manner. 

  • discoverdelicious
    Replied on October 28, 2016 at 10:42 AM

    Hi Owen.

    Glad to hear you've reproduced the issue, and thank you for sticking with me this long. Absolutely, take your time, looking forward to hearing from you.

    Michael