473,320 Members | 1,825 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Pop Up Frequency

1
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.
Jul 30 '08 #1
5 1634
acoder
16,027 Expert Mod 8TB
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.
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.
Jul 30 '08 #2
hsriat
1,654 Expert 1GB
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.
Expand|Select|Wrap|Line Numbers
  1. var chances = Math.floor(Math.random() * 100);
  2. if (chances <= 25) // there are 25% chances for this to be true
  3. showPopup(); // function to display popup
Jul 30 '08 #3
acoder
16,027 Expert Mod 8TB
You're probably right, but it depends if it's for a particular user or any time the page is loaded for all users.
Jul 30 '08 #4
hsriat
1,654 Expert 1GB
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.
Jul 30 '08 #5
acoder
16,027 Expert Mod 8TB
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.
Jul 30 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: christopher diggins | last post by:
I would like to survey how widespread the usage of smart pointers in C++ code is today. Any anecdotal experience about the frequency of usage of smart pointer for dynamic allocation in your own...
7
by: Dung Ping | last post by:
Such as: <script> //code aaaa zzzz ccc
11
by: NC Tim | last post by:
Hello, I think the question i have is fairly straightforward, but I can't seem to replicate the old SAS frequency procedure when I try to accomplish this in MS Access. anyway, i have about 10...
8
by: Pete | last post by:
I need to write a program to do a frequency analysis on a string of text. Firstly I need to get the alphabet A to Z for comparison but I'm not sure how to go about this. Is the following the...
19
by: jason_box | last post by:
I'm alittle new at C and I'm trying to write a simple program that will record the frequency of words and just print it out. It is suppose to take stdin and I heard it's only a few lines but I'm...
0
by: COBRA | last post by:
HI..could anyone help me out on this question? Consider the marks scored by students of a programming module. Allow the user to enter the number of students. The user shall then enter the marks...
7
by: Udhay | last post by:
How to get the frequency of an audio file and how to separate the low and high frequency of an audio file
8
by: Andrew Savige | last post by:
I'm learning Python by reading David Beazley's "Python Essential Reference" book and writing a few toy programs. To get a feel for hashes and sorting, I set myself this little problem today (not...
13
by: umpsumps | last post by:
Hello, Here is my code for a letter frequency counter. It seems bloated to me and any suggestions of what would be a better way (keep in my mind I'm a beginner) would be greatly appreciated.. ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.