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

Session source/medium (not set) #17

Open green17 opened 11 months ago

green17 commented 11 months ago

Question

We have an existing GA4 property collecting data (this is added through a cookie manager in line with GDPR) and have installed Instant Analytics for GA4 to handle the ecommerce side. As such we have turned off the "Auto Send PageViews" setting in the plugin to avoid a duplication of data. Commerce data is pulling through into GA4 but it is going to the "Unassigned" channel and the Session Source/Medium is coming through as (not set). Am I right in thinking that this is because we're not sending the pageview?

khalwat commented 11 months ago

Sounds possible / likely but I'm not sure tbh.

khalwat commented 11 months ago

How they you passing the source/medium to the page so I can check if that's one of the parameters that IA actually checks?

Also, it would help immensely if you could illustrate with an anonymized screenshot where the users end up showing up and where they would expect them to be, so I can get more context for what they are looking for.

green17 commented 10 months ago

We have a dual setup in the sense that we use a standard GA4 through Tag Manager instance alongside IA. Page views have been turned off for the Tag Manager to avoid data duplication.

Instant Analytics is setup as below, we haven't added any additional twig:

screenshot_1

In GA4 sessions source goes through as (not set) for e-commerce events. screenshot_2

For purchases the source/medium comes across as (not set) also. screenshot_3

jripmeester commented 9 months ago

@khalwat We have a exact same use case on our end. IS there any info i can feed you with to give some insight on how we could connect the IA session to the GTM session. We think that a solution in that direction would do the trick.

khalwat commented 9 months ago

Unfortunately, I still don't have a good answer here. Perhaps we can reach out to Google to find a solution?

bymayo commented 9 months ago

@khalwat Also having this issue where events are being passed but only for Desktop, not Mobile or Tablet (Even if the customer purchased on that device) I can see an open issue from the library your using to do most of the work in this plugin (https://github.com/br33f/php-GA4-Measurement-Protocol/issues/37) related to the same issue we're seeing.

khalwat commented 9 months ago

@bymayo Hopefully there is some kind of resolution.

geertvansoest commented 4 months ago

Is there any update on this? We have the exact same setup and facing the same issues.

It looks like there are commerce events in Google (add_to_cart, remove_from_cart, purchase) having a session source/medium, but it's (not set) for all purchase events having a revenue value.

bymayo commented 4 months ago

Still having this issue as the library this plugin uses hasn't fixed the issue.

Kind of makes this plugin useless for any marketing team as all results show as coming from Desktop devices.

khalwat commented 4 months ago

There's not much I can do about it, other than attempting to diagnose and fix the parent library -- assuming it isn't some complication with GA4 that I don't understand.

bymayo commented 4 months ago

@khalwat I did try and have a look at this myself, but GA4 API just goes over my head!