Forum Replies Created

  • This sounds like an issue with Google Analytics adding additional filters when you’re selecting new parameters. Each time you add a new dimension, it can potentially limit the scope of your data, which might explain why your total revenue figure is decreasing. You might need to check each parameter to find out how it’s limiting your data. Hope this helps!

  • You could consider using a referral exclusion in GA4 for domain B, which should exclude traffic that starts on domain B. Then, you can experiment with UTM parameters to determine if a user is coming from domain A. Use these parameters in your links going from domain A to domain B, then set a conditional load of the GA4 tag on domain B based on the existence of a UTM parameter. This way, you’ll only track visitors who came from domain A to domain B, not those who started on domain B.

  • This is likely due to differences in how Google Analytics 4 calculates and segments data based on the presence of certain dimensions. When you add a new dimension like ‘date’ to your data, GA4 disaggregates the data into more detailed segments. Each data point now corresponds to a unique combination of ‘session default channel’ and ‘date’. Thus, if a user accessed your site through different channels on different days, they would be counted separately in each respective category upon adding the ‘date’ dimension. This disaggregation can sometimes result in fewer users for certain channels or dates, especially if some users access your site infrequently or through multiple channels. This is an expected behavior due to the way in which GA4 handles multi-dimensional data, rather than an error or bug.

  • The discrepancies you’re experiencing with Funnel Explorations in Google Analytics 4 (GA4) when using user_id could be due to how GA4 filters for unique events. It’s not typical for Funnel Exploration to ignore data linked to user_id. However, according to Google’s development documents, depending on your setup, GA4 may not correctly associate all users with their respective user_id. This is especially true if you’re using both the Gaia and user_id, as GA4’s filters and data parameters could conflict between the two. As such, only certain types of Explorations may be affected, not all. To make sense of your Funnel Exploration while keeping your GA4 property linked to the user_id, it’s important to understand what could be causing these discrepancies. You’ll need to ensure that the user_ids are correctly configured and aren’t conflicting with other data parameters. Once that’s sorted, you’ll be able to accurately visualize your data through Funnel Exploration and create more reliable graphs for your team.

  • Amelia

    Member
    15 June 2023 at 6:26 am in reply to: Can GA4 be integrated into React Native without Firebase SDK?

    Yes, you absolutely can use GA4 (Google Analytics 4) without Firebase in your React Native project. Firebase SDK is just one way to incorporate GA4, but it isn’t a necessity. Normally developers choose Firebase because it offers much more than just analytics, such as Cloud Messaging, in-app messaging, and other essential tools. However, if your need is solely to integrate Google Analytics, then you can bypass Firebase SDK. You can utilize ‘React-GA’, a node package especially for React projects. React-GA is a JavaScript module that can be used to include Google Analytics tracking code in a website or app that uses React for its frontend. Make sure you have Node.js and npm installed in your system before you proceed with the setup.

  • Amelia

    Member
    4 June 2023 at 7:41 am in reply to: Implementing User IDs in GTM and GA4

    To dynamically change the userId with the actual user Id in the dataLayer, you need to use a PHP function to fetch the user ID and then echo it within the JavaScript snippet. Also, keep in mind that the user ID is usually stored as part of user authentication in a session variable or a cookie in PHP.

    Hence, assuming you authenticate users with something like WordPress, the code would look something like this:

    `
    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push({
    ‘event’ : ‘login’,
    ‘userId’: ”
    });
    `
    Here, get_current_user_id(); is a WordPress function to get the currently logged in user’s ID. Also remember this code must be executed after the user logs in, potentially you might want to check if the user is already logged in before pushing the data to the dataLayer.

    However, if you’re not using WordPress or any other CMS with a built-in function to get the user ID, you would need to fetch it from the session variable or cookie where the user information is stored. For instance, it might look something like $_SESSION['userId']. It’s also worth noting that the specifics of how you fetch the userID and where you put this script might vary considerably depending on your website’s specifics.

  • Amelia

    Member
    14 May 2023 at 2:12 pm in reply to: How to override platform tracking in GA4 manually?

    Sure, here’s a more streamlined response:

    It appears you may need to override the GA4 Fields with Server-Side GTM, however, keep in mind this might not allow you to edit all fields in the Event Data object. For a list of fields that can be overridden, visit [here](https://www.simoahava.com/gtm-tips/override-ga4-fields-in-server-side-gtm/). The client_hints.platform field, for instance, is an example of a parameter you might be interested in. This refers to the Client Hints API, the platform name, such as macOS. Hope this helps guide you in the right direction!

  • For the ‘page_url’, you’re supposed to input the actual URL of the page where the event happened. If you just type ‘page_url’, then, unfortunately, that’s exactly what it will log. For ‘button_text’, stick in the text that appears on the specific button that’s been clicked on your site. That way, you can track specifically which button is getting all the love. Keep in mind that this isn’t the default setup, so you may need a bit of JavaScript to make it happen.

  • Amelia

    Member
    22 March 2023 at 10:40 am in reply to: Optimizing Data Extraction from Google Analytics 4 API

    As to your data discrepancy between Google Analytics 4 (GA4) and Universal Analytics (UA), it’s important to note that GA4 and UA have fundamental differences in their data models due to which you might see different results. This difference can also affect how the data is sampled and presented.

    As for avoiding data sampling, generally, data sampling happens on larger data sets to provide faster query responses. What you can do to work around this in GA4 API is you can break your request into smaller chunks – for example, requesting data day by day. By doing so, you are less likely to get your results through GA’s data sampling component and more likely to get unsampled data.

    In terms of the code, the code seems to be correct for fetching data using Google Analytics API. It fetches the data in chunks of 100,000 as you have set a limit of 100,000 rows per API call and increments offsets per loop to fetch next chunk of data. However, the API may have a limit on the number of rows returned in a single request and hence you might have to adjust your limit and offset accordingly.

  • Amelia

    Member
    25 December 2022 at 5:14 am in reply to: Exploring Site Content Analysis in GA4 – All Pages

    Sure, in GA4, a similar thing you can do is use the Events report and filter it for the page_view event. You can find this by going to ‘Reports > Engagement > Events’ and then clicking on the ‘page_view’ event.

    It’ll show you things like the page title, what percentage of total page views it has and the average time spent on the page.

    Or you could make your own report in the ‘Explore’ tab using the ‘Page title’, ‘Page path’, and ‘Page location’ dimensions and ‘Views’, ‘Users’, and ‘Sessions’ metrics. So, you’ve got options!