Skip to content

Question: source value is not set #106

@tobz-nz

Description

@tobz-nz

For server-side events the source does not seem to be set/reported in GA. Is there a way to fix this? Maybe I'm not passing some data through?

I'm not passing the referrer, maybe that's required? This is essentially my setup:

        ....

        $this->analytics
            ->setClientId($event->clientId) // from _ga/_gid cookie value
            ->setUserId('C.'.$event->order->customer->getKey()); // user ID

        // set the purchase event details
        $this->purchaseEvent
            ->setSessionId($event->sessionId) // _ga_{MEASUREMENT_ID} cookie value
            ->setEngagementTime(100)
            ->setPageLocation($event->url)
            ->setPageTitle($event->pageTitle)
            ->setCurrency('NZD')
            ->setTransactionId($event->order->id)
            ->setValue($event->order->total)
            ->setShipping($event->order->total_shipping)
            ->setTax($event->order->total_tax);

        // add items
        ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions