A no-cookie way to show ad pup-up only a time

I did manage to realize a pure css pop-up but it works every time a new page is opened.
Maybe I’m asking for the impossible, but due to the fact that that way seems to me too heavy, so to say, I’d like a “lighter” way to pop-up a (no-Google) ads. I.g. a pop-up only for a time could be a solution, isn’t it?
Any suggestion?
Thank you!

Are you using a server side language? If so, you could set a session flag that would determine whether or not to render the popup. It’s still technically a cookie but server side instead of client side. You’d still get a pop up each user session (unless you have a DB backend that you’d allow a flag to be saved for the user)

1 Like

Alternatively you could look into localStorage. Fact of the matter is, you have to store the information somewhere.

3 Likes

As has been said. If you’re specifically looking to avoid cookies, there are workarounds that… kind of work.

Why, specifically, are you trying to avoid cookies?

1 Like

because of gdpr. I know that it’s a bit paranoic, but gdpr scares me.

As long as you not track any personal info from the user it is safe to use cookies! GDPR is about personal integrity (IP-addresses etc). Nothing else.

2 Likes

Additionally/conversely, GDPR isnt only about Cookies. Using a non-cookie way of tracking personal information does not magically get you out of GDPR requirements.

If you are setting a completely generic (read: No unique information, just a flag that says “has seen popup”) cookie, GDPR wont care about it.

3 Likes

Ok, but where could I get a code for a not-annoying pop-up?
Sitepoint has something like it, I guess, hasn’it?

“not-annoying” and “pop-up” dont… generally go in the same sentence. At least for me. Any popup is annoying.

Whats your definition of not-annoying?

2 Likes

You are right, but I mean at least a small bottom pop-up and an only one time pop-up.
Today I managed to make a pop-up quite beautiful (you can see it here), and it seems that its size and position is less annoying that my previous one.
I have now to set a cookie (to set it only a time) … and I don’t know how to do.

with some enhancements my pop-up is almost good. But I have a css problem: why bottom:0; doesn’t work as expected in small screen? I mean the position (the distance from the window bottom) is very different in different devices…

That’s a different question that had nothing to do with JS or cookies. I recommend you start a new thread in the CSS forum :slightly_smiling_face:

1 Like