Closed JElgar closed 4 years ago
Some questions:
What to do if a user has already signed up? What to do if a user has already closed the pop-up before? Is it just for the home page, or every page? Does the 30 second timer persist between page views? (e.g. on homepage so timer starts and then go to campaigns page)
Do we utilise cookies or local storage currently or have a concept of a session?
Currently, we have no concept of sessions. In the future, we will probably have user login on the site so they can interact with campaigns and comment on blogs post etc. For now, not having a concept of session will make the first two points rather tricky but its a very good point, I guess for now we'll have to show it after 30s every time someone launches the site. I think this should apply to any page, so for now if the user changes route we will still do the pop-up. If this adds more work then lets trail the popup on the home page first so we can be sure it's actually something we want then we can make the timer persist across all pages if we like it. If its easy enough to apply to all routes from the get go then let's just do that straight away
@JElgar
Currently, we have no concept of sessions. In the future, we will probably have user login on the site so they can interact with campaigns and comment on blogs post etc. For now, not having a concept of session will make the first two points rather tricky but its a very good point, I guess for now we'll have to show it after 30s every time someone launches the site. I think this should apply to any page, so for now if the user changes route we will still do the pop-up. If this adds more work then lets trail the popup on the home page first so we can be sure it's actually something we want then we can make the timer persist across all pages if we like it. If its easy enough to apply to all routes from the get go then let's just do that straight away
I had a look into the options and cookies seem suitable with the use of universal-cookie. We could use session (when the browser closes the session ends) expiry cookies for if a user dismisses the modal and some big number (1 year) expiry for if a user successfully signs up to the newsletter.
If we put the modal instantiation in some persistant component (haven't investigated it yet so unsure on the lifecycles) like the header navbar it should be clean to have it site-wide.
One issue to note is our privacy policy says we don't use any cookies (other than those provided by google analytics and Facebook pixel) so this is something we would have to update. If we can I want to avoid having to get people to consent to things as that just an extra barrier to entering the site. Cookies for this purpose really shouldn't be an issue tho as far as im aware (its something worth double-checking tho).
Might also be worth checking if there is a simpler way of doing this? There seem to be some nice solutions listed here: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Client-side_web_APIs/Client-side_storage
What do you think about this option? https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API
@JElgar
Good point about privacy. I had a look into local and session storage before and they seem suitable also. I'll see if I can get it working today
Here are the updated designs for the success message!
After approx 30 seconds of being on the website, a popup should be shown to sign up for our newsletter. The form should be implemented using mail chimp (it was in v2). Designs are in XD