# Trying to hyper-target our lurkers and incentivize sign-ups 🚀 (and run a JS on login)

**URL:** <https://meta.discourse.org/t/trying-to-hyper-target-our-lurkers-and-incentivize-sign-ups-and-run-a-js-on-login/70074>\
**Category:** Product Support\
**Created:** [September 14, 2017, 9:07pm UTC](https://meta.discourse.org/t/trying-to-hyper-target-our-lurkers-and-incentivize-sign-ups-and-run-a-js-on-login/70074 "2017-09-14T21:07:48Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![Justin\_Veenema](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justin_veenema/32/61263_2.png) [@Justin\_Veenema](https://meta.discourse.org/u/Justin_Veenema)\
**Post date:** [September 15, 2017, 9:22pm UTC](https://meta.discourse.org/t/trying-to-hyper-target-our-lurkers-and-incentivize-sign-ups-and-run-a-js-on-login/70074/14 "2017-09-15T21:22:43Z")

</div>

> [@simon](#):
>
> ```plaintext
> <script>
> &lt;script type="text/discourse-plugin" version="0.8"&gt;
> if (api.getCurrentUser()) {
> document.cookie = "logged_in=true; expires=Thu, 18 Dec 2017 12:00:00 UTC";
> }
> </script>
> ```

Simon, I owe you a beer my friend. This worked beautifully for us. 🍻

* * *

P.S. I’m a pretty big noob when it comes to cookies. Can I set the cookie to expire in 7 days? I’m sure it’s a simple tweak to the code, correct?

---

_[View the full topic](https://meta.discourse.org/t/trying-to-hyper-target-our-lurkers-and-incentivize-sign-ups-and-run-a-js-on-login/70074)._
