Forum Replies Created

  • Yes, with Google’s new gtag.js you can incorporate both Universal Analytics and GA4 within a single script snippet. Google’s global site tag (gtag.js) is designed to be a unified tracking system which simplifies the process of sending data to different Google tools such as Google Analytics (Universal and GA4), Google Ads, and Google Marketing Platform products. You’ll just need to configure it properly to ensure it sends the correct data to both your Universal Analytics property and your GA4 property. However, do keep in mind that even though this process requires only one script, it does not necessarily mean that your page load times will improve. You are essentially still running two analytics programs, they’re just contained within a single script.

  • Alexander

    Member
    23 May 2023 at 1:28 am in reply to: Comparing GA4 Purchase Revenue and Event Value Discrepancies

    Discrepancies between the purchase revenue and event value in GA4 could be due to a variety of reasons. One of the most common causes is due to the handling of shipping costs, taxes, and discounts. If these aren’t being factored into the purchase revenue but are included in the event value, it could cause a difference. Another possible reason could involve the use of different currencies. If the purchase revenue and event value are reported in different currencies, and the conversion rates aren’t accounted for, discrepancies could arise. Lastly, there could be a tracking issue involved where some transactions aren’t being accurately tracked, therefore causing a lower purchase revenue compared to the event value.

  • It seems from the Google Analytics 4 API documentation that the response body from the runPivotReport function does not directly contain date data. The API appears to assume that the user already knows the date ranges that were requested. Here’s the structure of the response body:

    `
    {
    “pivotHeaders”: [
    {
    object (PivotHeader)
    }
    ],
    “dimensionHeaders”: [
    {
    object (DimensionHeader)
    }
    ],
    “metricHeaders”: [
    {
    object (MetricHeader)
    }
    ],
    “rows”: [
    {
    object (Row)
    }
    ],
    “aggregates”: [
    {
    object (Row)
    }
    ],
    “metadata”: {
    object (ResponseMetaData)
    },
    “propertyQuota”: {
    object (PropertyQuota)
    },
    “kind”: string
    }
    `

    As you can see from this structure, there are no specific fields for the start or end dates of the date range.

  • Man, I totally feel your pain. I had a similar issue with a WordPress site not too long ago. You might want to have a look at the developer console for any errors that might be sneaking around. Also, and this is just a thought, you might want to check the consent cookie manager. Sometimes it could unexpectedly block the custom events. Keep your chin up and you’ll get it sorted!

  • Alexander

    Member
    5 April 2023 at 4:22 pm in reply to: What causes the discrepancy in Google's reported Total Users?

    Unfortunately, without being able to analyze the content of your shared chart, it’s difficult to provide an accurate answer. However, one possible explanation for discrepancies like this often tends to be overlapping users. If there are users who are counted in both the first and second row of your chart, then they would be double-counted in your calculation, but Google may be accounting for this overlap and only counting these users once, which could lower the total.

  • Alexander

    Member
    23 January 2023 at 9:20 am in reply to: How can I track hover events for multiple elements in this code?

    Yes, you have two concerns: tracking multiple images and tracking images based solely on their alt text. To accommodate multiple images, you can include all the selectors (class names or IDs) separated by commas when you call the function. As for tracking images by alt text, you’ll have to modify the code a bit. Currently, the code uses the element’s class or id to identify it. You can add an extra line of code to grab its alt text instead when no class or id is available, and then use that to track the hover event. So, it’s totally possible to adjust this code to meet your needs.

  • Your code inserts the Google Tag Manager and fires off a pageview event, which is then captured by Google Analytics. Post this, it redirects users to another site. This method generally works in most cases, especially if you see those events firing off in the Google Analytics Debug View. However, the issue can arise from the fact that Google Analytics sends data asynchronously, which means it doesn’t wait for a response from the server before moving on to the next task.

    In your case, the redirection might occur before the data is completely sent to Google Analytics and this could mean loss of some data. Unfortunately, Google Analytics doesn’t offer any out-of-the-box way to know if an event has been fully sent. One way around this is to use a JavaScript timer or delay to give Google Analytics some extra milliseconds or even a couple of seconds before the redirection occurs.

    However, a foolproof way would be to set up server-side tracking, where your server sends the data to Google Analytics instead of relying on the client’s browser. But that would be more complex, requiring server-side setup and may be beyond immediate need.

    Lastly, always ensure to test across different devices and network conditions to make sure your implementation works not just on your own device, but for users in different conditions.