

Henry
Forum Replies Created
-
Henry
Member20 June 2023 at 2:30 am in reply to: Troubleshooting issue with Google Analytics 4's set methodThe difference between the two snippets of code comes down to when and where the ‘foo’ value is set. In the first snippet,
gtag('event', 'testing', {'foo':'x'});
, the ‘foo’ variable is set directly within the event context. This means ‘foo’ will be sent with this event only.For the second snippet,
gtag('set', {'foo':'x'}); gtag('event', 'testing');
, ‘foo’ is set as a global configuration parameter, which should be applied to all subsequent events. But there’s a nuance – it does not append that parameter to the events that have already been sent or are queued to be sent. Possibly your ‘testing’ event has already been put into the queue by the time the ‘set’ command is executed.Also, it’s important to bear in mind that the ‘set’ command in GA4 doesn’t work like it did in Universal Analytics. In GA4, setting a parameter occurs on a per-event basis. If you want ‘global’ parameters, you have to use event defaults or user properties. If you want to associate ‘foo’ with every ‘testing’ event, you may need to modify your data layer or send ‘foo’ with every ‘testing’ event.
-
Henry
Member24 April 2023 at 3:50 pm in reply to: Troubleshooting GA Data API: pageLocation Dimension ErrorSure, I’d be glad to help. The issue you’re experiencing stems from a naming discrepancy. In GA4 associated with the GA Data API, the dimension name for full page URL is ‘pageLocation’ in Universal Analytics (UA), but in Google Analytics 4 (GA4), it has been renamed as ‘page_referrer’. Therefore, correct your YAML file to reference ‘page_referrer’ instead of ‘pageLocation’ as shown here:
`
dimensions:
– name: “browser”
– name: “country”
– name: “page_referrer”
`
Give this a shot and it should solve your problem. -
Henry
Member7 April 2023 at 7:51 pm in reply to: Linking Salesforce Leads to GA4 Conversions: Overcoming Session ID ChallengesHey there! Don’t worry, there are ways to pinpoint the specific session that led to a converted lead. You just need to include the session_id in your request to the Measurement Protocol.
Go ahead and look up the session ID using a couple of tried-and-tested methods. Either use this resource at https://developers.google.com/tag-platform/gtagjs/reference#get or just pull the session ID straight from the GA4 Cookie.
I understand your need to attribute the lead back to the exact session and hope this helps you get that sorted out!
-
Henry
Member28 January 2023 at 7:13 pm in reply to: Accessing Returning User Metrics in GA4 with Looker StudioThere is indeed a ‘Returning Users’ metric in Google Analytics, but it is not straightforward in Google Analytics 4 (GA4) as it was in the previous version. As you’ve already found, one method is to calculate it manually by subtracting new users from the total users. But, GA4 is more event-based and allows you to get more detailed information about your users. One recommended way is to take into account different events or interactions that users have with the website. You might also need to tweak your current set-up, metrics or dimensions to better track your ‘returning users’ or use the user engagement report in GA4. But unfortunately, at the moment, the simple ‘Returning Users’ metric is not part of Google Analytics 4 out of the box offering.