Forum Replies Created

  • Google Analytics 4 (GA4) employs a feature called ‘Identity Spaces’ to map the user journey across different events. This means that even if the user starts with a pseudo ID and later switches to a permanent user ID, GA4 can link these IDs together and understand they belong to the same user. Hence, it won’t treat them as different users once a permanent user_id is set. However, to ensure accurate tracking, it’s important to include both the user_pseudo_id and the user_id in all subsequent GA4 events once the user_id has been assigned.

    As for the ‘lost’ events in the funnel, there are a few possible causes. Firstly, it could be due to the redirection between different subdomains. GA4 sees different subdomains as separate entities and might not track the user journey across them unless you specifically setup cross-domain tracking. Another possibility is tracking prevention mechanisms like ad-blockers, which some users may have installed. These can prevent certain events from being tracked. Lastly, it could be due to the users not following the exact sequence of events in the funnel. For example, if a user skips one event in the funnel, they won’t be included in the final funnel visualization. As such, it’s important to validate your tracking setup and understand your users’ behavior on your site to fix any potential issues.

  • One possible issue could be related to how “first_open” events are handled. If there are users who have multiple “first_open” events (which sometimes can happen in GA4 if users reinstall the app, clear their cookies, or switch devices), they would be counted multiple times in your retention calculation. This could particularly inflate numbers for days after Day 0. To fix this issue, you can either filter out duplicate “first_open” events or retain only the earliest “first_open” event per user. Another issue could be related to the window of your data. If some users have their “first_open” event close to the end of your observed period, their activities in the following days could not be captured, resulting in underestimation of retention rates. It might help if you exclude users who have their “first_open” event in the last few days of your observed period from your calculation.

  • Ethan

    Member
    4 June 2023 at 5:27 am in reply to: Managing Analytics Configuration for UA and GA4 Reporting

    Sure, mate. So as of right now, there isn’t a straightforward way to have both UA and GA4 reporting in the same analytics.php file since Google’s v4 API does not support GA4. That being said, Google is developing a new API for GA4 which should solve this problem when it gets rolled out. For now, just stick to using them separately.

  • Ethan

    Member
    17 May 2023 at 4:11 pm in reply to: Investigating Discrepancies between BigQuery and GA4 Data

    The person is experiencing a discrepancy in the number of sessions recorded between two Google Analytic platforms, GA4 and UA. When the person counted the sessions from a particular day, the UA platform had recorded 104 sessions, and GA4 had recorded 331 sessions. They then tried using a tool called BigQuery to recreate the session count from GA4, using methods they found online, but the results were still lower than the 331 sessions GA4 had recorded. They are asking for assistance or suggestions to understand and resolve this discrepancy.

  • Ethan

    Member
    4 November 2022 at 12:09 pm in reply to: Unavailable custom event data in GA4 using Google Analytics Data API v4

    Yes, you’re on the right track with your observation and assumption. It’s important to note that event names are not part of the metadata that is returned by the endpoint you’re using. As such, only dimensions, metrics and the metadata related to them will be returned by the GetMetadataRequest.

    To fetch all events, you’ll need to use a different endpoint and method. Google Analytics Data API provides a method run_report() which you can use to fetch all event names (it’s important to note that this could be a huge number). Set ‘eventName’ in the list of ‘dimensions’ in the request parameters and execute the request.

    Furthermore, it’s accurate that only events marked as ‘conversion’ show up as metrics in the metadata, since GA4 differentiates these from normal ‘events’ for their expected high importance. Other events don’t automatically become metrics and won’t show up. However, you can create custom metrics based on these events in GA4 interface.

    Keep in mind that due to the flexible nature of event-based tracking, the Metadata API does not provide an exhaustive list of all possible event names, parameters, or event-scoped custom dimensions or metrics.

  • Good news, I figured it out on my own! For keeping the variant title or id of the item updated on a ‘cart addition’, the trick is to add an iteration on product.variants within the ecommerce variable. Then point it to the suitable liquid variable – this could be variant.title or variant.id.

    
    {% if template contains 'product' %}
     dataLayer.push({
       'ecommerce': null
     });
     var ecommerce = {
       'items': [{
         'item_id': {{product.id | json}},                 
         {% for variant in product.variants %}
         'item_variant': {{variant.title | json}},
         {% endfor %}               
         'item_name': {{product.title | json}},
         'price': {{product.price | divided_by: 100.0 | json}},
         'item_brand': {{product.vendor | json}},
         'item_category': {{product.type | json}},
         'item_list_name': {{collection.title | json}},
         'description': {{product.description | strip_newlines | strip_html | json}},
         'imageURL': 'https:{{product.featured_image.src|img_url:'grande'}}', 
         'productURL' : '{{product.url}}'
       }]
     };              
     $(__DL__.cartTriggers).click(function(){
       dataLayer.push({                    
         'event': 'add_to_cart',
         ecommerce
       });                  
     });              
    {% endif %}
    

    So there you have it! This code should take care of keeping the variant updated when adding to the cart.