Pop Up Frequency

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LuciaF
    New Member
    • Jul 2008
    • 1

    Pop Up Frequency

    Hi there:

    I'm not a developer but I work for a market research company who specialise in online surveys. We have a requirement from a client to build a pop up survey which they can place on their site to invite a random selection of their users to the questionnaire. However, in order not to annoy their customers, they only want the pop up to appear around 20-30% of the times the homepage is loaded, not every time. Also once a user has completed the survey, we don't want them to be able to complete it again.

    I have had a look online at some freely available popup scripts and some pop up script software, but none seem to offer the "pop up frequency" functionality I am looking for. Either the popup will display once per session, or once per x minutes, which is not what I want. I know this percentage frequency is possible as we used to have this functionality with another survey software we used to use, but I don't have access to the popup script they used to make the popup.

    Any help on scripting this or suggestions would be appreciated.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Originally posted by LuciaF
    However, in order not to annoy their customers, they only want the pop up to appear around 20-30% of the times the homepage is loaded, not every time.
    This won't be possible with JavaScript unless you're talking about one user only.
    Originally posted by LuciaF
    Also once a user has completed the survey, we don't want them to be able to complete it again.
    This should be possible by setting a cookie. Read the cookie on page load. If set, do not display the popup.

    Comment

    • hsriat
      Recognized Expert Top Contributor
      • Jan 2008
      • 1653

      #3
      Originally posted by LuciaF
      However, in order not to annoy their customers, they only want the pop up to appear around 20-30% of the times the homepage is loaded, not every time.
      This is possible. When we talk about "around 20-30%" we have to consider probability. So let the function which is used to display popup be dependent on a simple mathematical statement.[code=javascript]var chances = Math.floor(Math .random() * 100);
      if (chances <= 25) // there are 25% chances for this to be true
      showPopup(); // function to display popup[/code]

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        You're probably right, but it depends if it's for a particular user or any time the page is loaded for all users.

        Comment

        • hsriat
          Recognized Expert Top Contributor
          • Jan 2008
          • 1653

          #5
          Originally posted by acoder
          You're probably right, but it depends if it's for a particular user or any time the page is loaded for all users.
          uummmm.. I don't think it has any dependencies like you said, but yes, you can't be 100% sure that out of 100 users, exactly 25 users would get the popup. But I think this is the closest possible solution.

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            Ah right, I see what you're saying. I guess you could have it at 20-30% for each individual user perhaps by setting a cookie when a popup is shown once to fix it. You could fix it at 25% by showing it once every four times, though I personally hate popup windows, but that's a different story.

            Comment

            Working...