

Samuel
Forum Replies Created
-
Samuel
Member8 July 2023 at 1:40 pm in reply to: Issue with missing dates in GA4 API response when creating daily chartThe issue might be related to how the Google Analytics 4 API is interpreting the dateRange values you are providing. Check first if the date format you are using is correct, the valid format for GA4 is “YYYY-MM-DD”. Moreover, ensure that there’s data for the whole range of dates you’ve requested. The GA4 API only returns data for the dates where there’s activity to report. If the only date being returned is
20221227
, it might be because that’s the only date within your specified range that has any data. So, it’s also important to confirm that events were being properly tracked during this period. If you’re still experiencing issues, it may be worth verifying your API request and the accompanying parameters or contacting Google’s support for more specific help. -
Samuel
Member6 July 2023 at 8:18 am in reply to: Retroactive Dimension Filling in GA4 using Page DataUnfortunately, because data in Google Analytics is processed at the time of collection and is not retroactive, you cannot recover the old dimensions data that was incorrectly configured. The incorrect setup would mean the data was likely not stored in the way you intended. However, any dimensions sent in the URLs during page views might be recoverable by analysing the URL data, which would require a manual extraction and analysis of the URL data. Going forward, it’s recommended to correct the setup as you have indicated to ensure the data is sent and stored correctly. You should also regularly check and validate your data to ensure it’s being captured correctly.
-
Samuel
Member5 July 2023 at 9:07 am in reply to: Adding `host_name` using Measurement Protocol for GA4: Is it feasible?GA4’s Measurement Protocol is significantly different from Universal Analytics. The familiar ‘dh’ parameter (document hostname) from Universal Analytics, doesn’t exist in GA4. Therefore, the idea of passing ‘host_name’ in the same manner does not work in GA4. The GA4 protocol uses an event-based model, therefore, most of the parameters you passed in Universal Analytics need to be sent as part of an event’s parameters for GA4. However, as of right now, there is no direct equivalent to passing ‘host_name’ in GA4. A possible solution could be to define a custom parameter for ‘host_name’ as part of your events if you feel this data is crucial. Please make sure to check GA4’s documentation for the latest updates and changes.
-
Samuel
Member4 July 2023 at 3:07 pm in reply to: Inconsistencies in Google Analytics Data API (GA4) when using the date dimension alongside other dimensionsThe behavior you are observing may be attributed to how Google Analytics 4 (GA4) processes and attributes user data. Active users, considered as a metric, are deduplicated across the selected dimension. If you select “session default channel” as the dimension, GA4 deduplicates the user counts across the different channels. Consequently, when “date” is added as an additional dimension, Google Analytics 4 starts deduplicating active users for each channel across each distinct date. This may result in smaller user counts for some channels on specific dates due to this deduplication, which might make the user count appear inconsistent with your earlier query that didn’t include “date”. However, this is not a bug but an expected behavior based on the design of the GA4 data model. Perfect consistency in user count across different dimensions is not guaranteed due to this method of data processing and deduplication.
-
Samuel
Member3 July 2023 at 3:29 am in reply to: Error encountered while calculating median using percentile_cont functionThe error message is saying that the function “PERCENTILE_CONT” isn’t being used correctly. This function needs two specific types of numbers as inputs, but in your code, it’s getting a different type of data that it doesn’t know how to handle. To fix this error, you need to make sure that the data you’re feeding into the function is of a compatible type. From the error message, it’s clear that supported types are decimal numbers (FLOAT64), precise numbers (NUMERIC), and large precise numbers (BIGNUMERIC). Keep in mind that these requirements may vary depending on your specific data and setup.
-
Samuel
Member22 June 2023 at 6:23 pm in reply to: Determining Independent Client IDs for Google Analytics 3 and Google Analytics 4 on a Single PageIn simpler terms, what you are experiencing is because Google Analytics 4 (GA4) doesn’t use the same method for client ID tracking as Google Analytics 3 (GA3) does. While GA3 uses “_ga” cookies, GA4 provides this ID differently. Therefore, when using both on the same page, they are not sharing the same client ID, they just work in different ways.
-
Sorry mate, Google Analytics 4 (GA4) doesn’t have built-in tools the way GA3 does for tracking site speed. You’re going to have to DIY this one – you’ll need to generate your own data using custom metrics on the page_view event and create a tailor-made report.
They’ve got this interface called PerformanceNavigationTiming with loads of timing information you could use. Have a look. [PerformanceNavigationTiming] (https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming)
The Core Web Vitals include Largest Contentful Paint (LCP), which is about page load speed. Google Chrome’s developed a library that might come in handy – [web-vitals](https://github.com/GoogleChrome/web-vitals)
In fact, there’s loads of write-ups online about nailing the Core Web Vitals in GA4, exporting the data to BigQuery, and then pulling up reports in Looker Studio. I’ve even chipped in with my two cents đ. So, keep experimenting, you’ll figure it out!
-
Samuel
Member24 May 2023 at 7:50 am in reply to: How to monitor social media interactions with Google Analytics 4From your explanation, it appears you’re trying to break down your event counts by
itemId
. However, you’re facing an issue because the recently announced schema compatibility changes make it impossible as item-scoped dimensions likeitemName
are incompatible with event-scoped metrics likeeventCount
. Unfortunately, with these new changes, you might not be able to have the breakdown you desire without some modifications in your data tracking or analysis process.You might need to adjust how you track these events, perhaps by incorporating information about
itemId
into a different parameter that is compatible witheventCount
for analysis. Alternatively, you might need to reconsider the necessity of having a breakdown byitemId
under these circumstances. Given the limitations of the new schema compatibility changes, you might find value in conducting a broader analysis of your event counts without such granularity. If you’re really having trouble, reaching out to Google Analytics’ support team or community forums might yield some insightful solutions. -
Samuel
Member15 May 2023 at 1:00 pm in reply to: Troubleshooting Issue with Classname Trigger for ElementFrom your shared code, it’s hard to pinpoint the issue without additional details. However, common issues can be related to spelling/case-sensitivity in the class name or the structure of the HTML. You can use the Google Tag Manager’s preview mode feature for troubleshootingâthis will help to ensure that clicks on the target element are properly recognized, and that the class of the clicked element matches exactly with what you’ve provided in the Google Analytics tag setup.
-
Samuel
Member8 May 2023 at 10:20 pm in reply to: Measuring Page Views and Exits in Google Big Query with GA4 IntegrationTo count the instances where the last event of a session occurred on a specific page (a.k.a “Exits”), you can make use of the
user_pseudo_id
andevent_timestamp
fields to find the last event in each session. The approach involves grouping byuser_pseudo_id
and then ordering matters byevent_timestamp
to find the last event for each user.You would then join this result back to your main table to retrieve the page_path of these last events and count the occurrences for each. The query could look something like this:
`sql
WITH last_event AS (
SELECT user_pseudo_id, MAX(event_timestamp) as last_event_timestamp
FROMMY_ga4_dataset.events_*
GROUP BY user_pseudo_id
)SELECT event_params.value.string_value AS page_path, COUNT(*) AS exits
FROMMY_ga4_dataset.events_*
JOIN last_event
ON events.user_pseudo_id = last_event.user_pseudo_id AND events.event_timestamp = last_event.last_event_timestamp
WHERE event_name = ‘page_view’ AND event_params.key = ‘page_location’
GROUP BY page_path
ORDER BY exits DESC
`
In this query, the
last_event
subquery finds the timestamp of each user’s last event. In the main query, you join thelast_event
subquery to your main table to find those instances where the main table’sevent_timestamp
matches thelast_event_timestamp
from the subquery, indicating it is the last event in the session. You filter for'page_view'
and'page_location'
accordingly.Please remember to replace
MY_ga4_dataset.events_*
with your actual dataset name. Also, ensure the dates are suitable inevents_*
part if you are querying over a certain date range. -
Samuel
Member13 October 2022 at 5:15 pm in reply to: 'I have upgraded to GA4, but I am not receiving real-time reports like I did in Universal Analytics. Is this achievable? Please take a look at the pictures below.'You may not be able to get your GA4 results to look exactly like your Universal Analytics results because these are two different platforms with different ways of measuring and reporting. The main difference is that Universal Analytics is session-based while GA4 is event-based. That being said, you may be able to get similar data by exploring GA4’s new features and options. To do this, go to ‘reports’ and create a new report based on your requirements. If you’re looking for real-time data like in Universal Analytics, go to the ‘real-time’ section in GA4. Here, you’ll see data from the last 30 minutes by default, but you cannot change it to display data from the last 5 minutes as you could in Universal Analytics. So, getting exact same look or functionality might not be possible due to fundamental differences between these two platforms.