GithubHelp home page GithubHelp logo

Ability to set user on javascript about ahoy.js HOT 7 OPEN

gknedo avatar gknedo commented on August 21, 2024
Ability to set user on javascript

from ahoy.js.

Comments (7)

gknedo avatar gknedo commented on August 21, 2024 3

Working on it

from ahoy.js.

ankane avatar ankane commented on August 21, 2024

There's no way to do this right now, but happy to accept a PR (will need to get it added to Ahoy Ruby project as well). Maybe something like:

ahoy.setUserId(1);

from ahoy.js.

nabilfreeman avatar nabilfreeman commented on August 21, 2024

I'd also be really interested in this feature - @gknedo looking forward to seeing the result!!!

from ahoy.js.

gknedo avatar gknedo commented on August 21, 2024

@nabilfreeman WIP, working o ruby gem now.

from ahoy.js.

artyrcheek avatar artyrcheek commented on August 21, 2024

Is this available?

from ahoy.js.

nabilfreeman avatar nabilfreeman commented on August 21, 2024

Still interested too... lol. Prepare yourself for the following crime against humanity...

I wrote a Lambda that checks the Ahoy tables every 30 min and copies properties.user_id to the user_id column in both events and visits table. Works great as our throughput is currently below 1m rows per 30min, but very wasteful and kind of dumb to maintain.

(This is because we don't run rails but still use Ahoy separately from our Node stack)

from ahoy.js.

artyrcheek avatar artyrcheek commented on August 21, 2024

This was my hacky solution using the ruby gem.

def track_event(data)
    if data[:properties]["shop_id"]
      data[:shop_id] = data[:properties]["shop_id"]
      data[:properties].delete("shop_id")
    end
    super(data)
  end

I set the user_id (or shop id in my case) as a property, then i listen track_event, and set the shop if if there is a shop id property

from ahoy.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.