Giter VIP home page Giter VIP logo

Comments (5)

rvanbaalen avatar rvanbaalen commented on September 27, 2024

Are you calling PostHog::init in the queue job as well?

Sounds like PostHog::init wasn't called

from posthog-php.

IsraelOrtuno avatar IsraelOrtuno commented on September 27, 2024

Facing the same problem. I have tested calling PostHog::init in the queued job as well but still didn't work:

        PostHog::init(config()->get('services.posthog.api_key'), [
            'host' => config()->get('services.posthog.host'),
        ]);

        PostHog::capture([
            'distinctId' => $this->user->getKey(),
            'event' => 'user:registered',
            'properties' => [
                'registered_via' => $this->registerdVia,
            ],
        ]);

However it does work when running the job synchronously.

from posthog-php.

nwdles avatar nwdles commented on September 27, 2024

batch_size as optional parameter solved my problem (we don't have 100 events in time, that's why we didn't catch events in PostHog)

from posthog-php.

IsraelOrtuno avatar IsraelOrtuno commented on September 27, 2024

@nwdles could you show an example? I am confused about that parameter. Do yo mean this?

https://posthog.com/docs/api/post-only-endpoints#batch-events

from posthog-php.

nwdles avatar nwdles commented on September 27, 2024

https://posthog.com/docs/api/post-only-endpoints#batch-events

I mean this
Posthog::init(config('posthog.api_key'), ['host' => config('posthog.url'), 'batch_size' => 1]);

from posthog-php.

Related Issues (18)

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.