

Henry
Forum Replies Created
-
Henry
Member25 June 2023 at 9:17 am in reply to: Troubleshooting: Inconsistency with GA4 custom event firing outside of tagassistant preview modeThis kind of issue usually boils down to some kind of discrepancy between what’s happening in preview mode versus the live site. You might be running into some sort of conflict with your trigger. Check whether you’ve set your trigger to fire on all pages or just some pages. Also, it’s possible that there’s a problem with the event itself, for example, if it’s dependent on some condition that isn’t being met outside preview mode. Also, check whether there are any other tags firing at the same time that could interfere with your custom page_view tag. If none of these checks yield any issues, then you might want to use the browser’s developer tools to do a more detailed debugging, or consult with a fellow GTM expert for deeper insight.
-
Henry
Member29 May 2023 at 5:24 am in reply to: How can I ensure consistent _ga cookie creation between GA4 and UA?The difference between GA1.2 and GA1.1 isn’t related to GA4 and UA, but reflects the structure of the _ga cookie used by Google Analytics in general. Generally, GA1.2 or GA1.1 refers to the domain depth, not the version of Google Analytics. This essentially means the number of domains under the main domain where the cookie is active. But if you’re experiencing discrepancies with user tracking, it might be more related to how your GA4 and UA tags are set up rather than the cookies themselves. Make sure that both are tracking the same information correctly. In theory, both the GA4 and UA tags should be generating the same version of the _ga cookie, therefore the differential shouldn’t be a big issue in your analytics tracking. If the problem persists, it’s recommended to consult with a Google Analytics expert or reach out to the Google support team.
-
Henry
Member23 April 2023 at 10:37 am in reply to: Retrieving Google Analytics Data in a Spring Boot Web AppLet’s break down the task we need to accomplish. The “AnalyticsService” will be receiving the slug of a book and it needs to communicate with Google Analytics to get the view count. For this, you will have to use the Google Analytics Reporting API v4.
When you start creating your AnalyticsService, you will need to first initialize a service object with your credentials which you can store as environment variables. These credentials would be your API key, client id and client secret that you can get from the Google Cloud Console. You will need to ensure you have the reporting API enabled for your project.
After initializing your service object, you would then be calling the ‘batchGet’ function on the service object inside your “receiveDataFromAnalytics” method. You would input a ‘GetReportsRequest’ object where you would set the ‘viewId’, ‘dateRanges’, ‘metrics’, and ‘dimensions’ in a ‘ReportRequest’ object and put that inside a list. The ‘viewId’ would be your Google Analytics view ID, ‘dateRanges’ would determine the range of dates you want the data from (you can set it to ‘allTime’ if you want the total views), and ‘metrics’ and ‘dimensions’ would depend on what you are trying to get. In your case, for ‘metrics’ you would set the ‘expression’ as ‘ga:pageviews’ and in ‘dimensions’, you would set the ‘name’ as ‘ga:pagePath’. This basically means that you are asking for a report of the page views per page path.
Next, you would read the response. This would be in the form of a list of report objects and each object would contain columnHeader and data properties. You can thus loop through the list and get your measurements from the ‘metrics’ array in the ‘rows’ array in the ‘data’ property.
Remember to catch any possible exceptions that may arise due to failure of the API call or in case the slug doesn’t exist in your Google Analytics data. It’s always good to have substantial logging in place so you can understand where things may have gone wrong if they do.
Unfortunately, I don’t have a tutorial to recommend, but I suggest you keep an eye on the Google Analytics API official developers documentation as Google keeps it updated. I understand that it may be typical to grasp at first, but it would get simpler as you explore more. Stack Overflow is also a useful resource for related queries.
-
This discrepancy might arise from the differences in how UA and GA4 handle and interpret data. UA is session-based while GA4 is event-based. GA4 does not automatically remove bots and spiders from the data, while UA does. This could potentially inflate your user count significantly in GA4.
Furthermore, GA4 handles new users differently than UA. In UA, a new user is defined as the first session by a user during a selected date range. In GA4, every event that doesn’t explicitly specify a user ID or a device ID is counted as a new user, which naturally inflates the new user count significantly.
Lastly, consider that GA4 might count users across devices and platforms by default if they are logged into their Google account, rather than treating each device as a separate user like in UA. This could also inflate the user count in GA4 if your users tend to switch devices or browsers.
For these reasons, comparing UA to GA4 in terms of user count isn’t like comparing apples to apples. These platforms have fundamentally different methodologies for tracking users and events, making direct comparisons difficult. You might want to take these differences into account when interpreting data from GA4.
-
Henry
Member14 April 2023 at 5:01 pm in reply to: Do I need to modify website code for GA4 property linked to UA to switch from UA- to G-ZZZ?As a frontend developer, you might be trying to navigate Google’s GA4 switch-over and it certainly comes with its puzzling moments. You’re right in your understanding of having to set up a GA4 property and link it to UA – it’s the first step and generally a simple undertaking.
You’re not wrong to wonder about the gtag and UA-ZZZ. It’s important to consider that Google will stop processing new data for Universal Analytics properties after July 1, 2023, which means the UA-ZZZ would no longer be practical. From that point, it’ll be all about the new G-ZZZ, aka the GA4 tracking ID.
If you’re uncertain about the new ID, you can see it for yourself. Just go to your GA4 property, then to Admin, followed by Data Streams. Clicking on View tag instructions and then the Install manually tab will show you that the GA4 tag has followed suit and is now in the G-XXXXXXXXXX format, matching the new measurement ID. So, in the end, it’s all about making that transition in time and getting used to the new normal in Google Analytics!
-
Henry
Member7 March 2023 at 11:53 pm in reply to: Inaccurate Transaction Data in Google Analytics (GA4)You’re using GA4 and you’re noticing some peculiar things when generating reports with different date filters. Your event counts change depending on whether you filter by half a month, a full month or one and a half months – it’s weird, right? This could be because these reports are heavily sampled – they’re giving you a snapshot based on just 9.52% of your total data. So, you’re getting a small taste, not the full meal which might affect the report’s accuracy.
-
Henry
Member19 February 2023 at 6:13 pm in reply to: Integrating CSV Uploads with GA4 Custom Datasources via APIAs of now, Google Analytics 4 (GA4) does not officially support data import like Universal Analytics (GA3) did. Data imports were a feature in Universal Analytics that allowed you to join the data generated by GA with other data sets. But in GA4, there isn’t a one-to-one feature that replicates this. Nonetheless, GA4 provides opportunities for more direct interaction with the Google Cloud Platform, which opens up ways to supplement your analytic data using facilities such as BigQuery. Some would recommend using the API as well but currently, the GA4 Data API is in a beta stage. Therefore, it’s recommended to watch Google’s updates for the GA4 regarding these features, as there is a possibility they may add it in the future.