Forum Replies Created

  • Jesse

    Member
    4 July 2023 at 5:55 am in reply to: Retrieving a List of Accounts in Google Analytics 4 Admin

    The issue you’re experiencing might be linked to the permissions of the account used to create and authenticate your PHP client. Whether you’re using OAuth 2.0 or a Service Account for authentication, the account needs to have sufficient rights across all the accounts you’re trying to access. If the account only has access to one of your GA4 accounts, it would explain why you’re only seeing one result. To fix this issue, review the account’s permissions on all your GA4 and old Google Analytics accounts, ensuring it has enough access. If your account has appropriate permissions yet you’re still facing the issue, there may be a problem with the Google Analytics Admin API, specifically with the “listAccountSummaries()” and “listAccounts()” methods. You might want to refer to the API documentation or reach out to Google’s support for a possible solution or workaround.

  • Both ways work, but usually it’s recommended to place the script just before the closing tag. This is to ensure the script gets loaded early but doesn’t block the rest of your site from loading. However, it’s a minor detail and the impact on your site performance would be negligible either way.

  • Jesse

    Member
    12 June 2023 at 10:04 am in reply to: Troubleshooting input value recognition in Angular using dev tools

    It looks like the issue might be that you’re trying to trigger a change, but the system is not recognizing it. Because of how some systems are built, your script may need to not just make the change but also trigger a specific event to make the system realize the change happened. You may have more luck if you use a different method, like trying to trigger an “input” event instead, as some systems listen for this instead of a “change” event.

  • Jesse

    Member
    5 June 2023 at 9:50 am in reply to: Aggregating GA4 Event Data by Session ID in BigQuery

    SQL queries can seem complex, but the trick is breaking them down into smaller and more manageable parts. Here’s an approach that I’ve found works quite well for understanding sequences of events. It might take a bit more time because it’s set up to look at other things as well, but it’ll get you what you need:

    with _latest as (
      SELECT 
        --create unique id
                concat(user_pseudo_id,(select value.int_value from unnest(event_params) where key = 'ga_session_id')) as unique_session_id,
        
        --create event id
            concat(user_pseudo_id,(select value.int_value from unnest(event_params) where key = 'ga_session_id'),event_name) as session_ids,
              event_name,
              event_date,
               
              TIMESTAMP_MICROS(event_timestamp) AS event_timestamp
            FROM  *******
           
            where
                -- change the date range by using static and/or dynamic dates
               _table_suffix between  '20221113' and '20221114'),
         Exit_count as (
            select *,
         row_number() over (partition by session_ids order by event_timestamp desc) as Event_order
            from _latest)
        
            select 
        Event_order,
        unique_session_id,
            event_date,
            event_name,
            
       FROM
            Exit_count
        
      group by
            Event_order,
            event_name,
            unique_session_id,
            --pagepath,
            event_date
            --Country_site
            order by
                unique_session_id, 
                Event_order 
    

    Don’t worry if you’re new to SQL. Over time you’ll find it easier to write complex queries confidently.

  • For eCommerce transaction tracking with GA4, it’s best to send both the core product and the addon. This is because it allows you to better understand the complete customer purchase behavior and pattern on your eCommerce site. Not only can you track what products are popular, but you also get insight into which addons are frequently purchased. It’s important to know that addons like warranties, gift wrapping, or extra scuba tanks, while not standalone products, contribute to your overall revenue and their performance should be tracked. Google Analytics’ enhanced eCommerce setup allows you to accomplish this by letting you track product and promotion impressions, product clicks, viewing product details, adding a product to a shopping cart, initiating the checkout process, transactions, and refunds. Sending all these events gives you a comprehensive picture of the user’s journey. Make sure you to follow the best practices and guidelines of GA4 for the best results.

  • The problem you’re having seems to be tied to how Google Analytics 4 processes events and parameters coming through its Measurement Protocol API. Apparently, custom parameters specified in these events are not instantly accessible for custom event creation, hence your event with the “user_plan” equals “testing_plan” condition isn’t triggering. In contrast, when events are sent via gtag, the parameters are recognized immediately, explaining why your custom event works in this scenario. This is not explicitly stated in the documentation, which might be why you are facing confusion. Until Google addresses this, a workaround could be to keep using gtag for these events if possible.

  • Jesse

    Member
    21 January 2023 at 2:18 am in reply to: Encountering GRPC Connection Issue with Google Analytics Data V1Beta

    The error message you are encountering suggests that there is a problem connecting to the GRPC server. Here are a few suggestions to help resolve the issue:

    1. Check your internet connection: Ensure that you have a stable internet connection. Sometimes network issues can cause connection problems.

    2. Verify API credentials: Double-check your API credentials (such as API keys or service account credentials). Make sure you have the correct credentials and they are properly configured.

    3. Check firewall or network restrictions: If you are working within a corporate network or behind a firewall, there might be restrictions in place that are preventing the connection. Contact your network administrator to verify if any restrictions are causing the issue.

    4. Update GRPC version: Ensure that your GRPC version is up to date. Check for any available updates and consider upgrading to the latest version to see if it resolves the problem.

    5. Retry after some time: The error message you received indicates that the server is currently unavailable. It could be a temporary issue on the server-side. You can try again after some time to see if the issue is resolved.

    6. Check service status: Verify the status of the GA4 analytics API service. There could be a known service disruption or maintenance activity impacting the availability of the service. You can check the Google Cloud Platform Status Dashboard or the API documentation for any service notifications.

    If none of these suggestions resolve the issue, it might be helpful to reach out to the Google Analytics support team for further assistance. They can provide more specific guidance based on the nature of the error and your specific setup.

  • Jesse

    Member
    20 December 2022 at 5:42 am in reply to: Using cURL with GA4 Measurement Protocol

    Without having access to your PHP source code, it’s fairly difficult to pinpoint what exactly could be causing the problem. However, the HTTP status code 204 generally represents ‘No Content,’ which essentially means the server has successfully processed your request, but it did not need to return an entity body (any kind of content) – usually typical for POST requests. This could be the reason why you’re not seeing any data being sent back. If you’re trying to retrieve information, you might need to re-examine the type of request you’re making.

    As for the silent Google Analytics real-time dashboard, are you sure that you’re sending the data to the correct GA4 property? Sometimes, misconfigurations can occur, and you might be sending data to a different property than intended. You also want to double-check that your curl request follows the requirements of the GA4 Measurement protocol.

    If these advisements don’t seem to solve the issue, I’d recommend sharing your PHP code to provide more context so you can get a more specific and concrete solution.