nystudio107 / craft-instantanalytics-ga4

Instant Analytics brings full Google GA4 server-side analytics support to your Twig templates and automatic Craft Commerce integration
Other
3 stars 4 forks source link

How to Track Users and New users in Google Analytics? #23

Closed obuchmann closed 10 months ago

obuchmann commented 10 months ago

Question

We switched to the Server Side only implementation of this Plugin. The Page View Statistics and all custom Events work fine but the Users and New Users Statistics on Google Analytics dropped to zero.

Is it possible to get this data back into Google Analytics without using the gtag.js?

Additional context

Our relevant Settings:

return [
  /**
     * Should page views be sent automatically when a page view happens?
     */
    'autoSendPageView' => true,

    /**
     * If you plan to use Instant Analytics in conjunction with frontend JavaScript, this setting should be on, so that Instant Analytics requires a `clientId` from the frontend-set GA cookie before it will send analytics data.
     */
    'requireGaCookieClientId' => false,

    /**
     * Should the GCLID cookie be created if it doesn't exist?
     */
    'createGclidCookie' => true,

]
khalwat commented 10 months ago

Answer is “probably not”, as sessions are managed by gtag..

Key Point: The intent of the Measurement Protocol is to augment automatic collection through gtag, Tag Manager, and Google Analytics for Firebase, not to replace it.

https://developers.google.com/analytics/devguides/collection/protocol/ga4