

George
Forum Replies Created
-
George
Member18 June 2023 at 7:32 pm in reply to: Troubleshooting Custom JavaScript Variables in Google Tag ManagerThe issue comes from the fact that you’re trying to use regex on the wrong kind of object. The document.body is an HTML object, not a string. If you want to scan the body of your HTML for a specific word, you need to convert the body to a string first. You can use the
innerHTML
property to achieve this. Your function would then look like this:`javascript
function() {
var bodyContent = document.body.innerHTML;
var result = /stellar/.test(bodyContent);
return result;
}
`
So with this update, you are checking if the word “stellar” is anywhere within the HTML of your body, not within the body object itself. -
George
Member13 June 2023 at 12:37 am in reply to: Troubleshooting Timeout Issue Running GA4 on Spark / DatabricksIt definitely sounds like a complex issue, Eric. The error you’re seeing, DEADLINE_EXCEEDED, is generally indicative of a task that is taking too long, which as you’ve noted, isn’t due to the size of the query. Your cluster demonstrating successful communication with the universal analytics API would also suggest it’s not an inherent connectivity issue. Although, it could be caused by network latency or a server-side issue at Google. It might also be a threading issue in how the requests are being made. The first thing I would suggest is increasing the timeout setting to see if that resolves your issue. However, dependency issues could also be a potential cause in cases like this. Checking your cluster logs for BEGIN dependency errors or conflicts should give you a better understanding. Another avenue to investigate would be any differences in environmental conditions between your local setup and your Databricks environment. Lastly, given the unique combination of technologies and APIs, you might be encountering a less common, undocumented issue for which reaching out to the Databricks and/or Google Analytics 4 support teams may yield the fastest resolution.
-
George
Member17 April 2023 at 10:56 pm in reply to: How to track user engagement and page views for articles written by our writer using custom dimensions in GA4To extract the specifics data such as the “Editor name” and the “Published Date” from GA4, you’ll want to use Google Tag Manager (GTM) in tandem with GA4. The first step is to create user-defined variables in GTM to capture these specific elements. You’ll likely need to use JavaScript or jQuery selectors to capture these data points from your site. Once you’ve implemented the required custom JavaScript variable, run a test to be sure you’re pulling the correct data.
Once these variables are in place, you’ll next need to configure your GA4 settings. In addition to the standard data sent by GTM to GA4, you’ll want to add a new parameter. The Parameter Name should match the key you want in GA4 (e.g., “editor_name”), and the value should correspond to your newly created GTM variable (e.g., {{Editor Name}}).
However, you’ll also have to configure GA4 to collect the new data. This involves creating a new custom definition in GA4 that matches the parameters we’re sending over from GTM. Navigate to the GA4 property, then ‘All Events’ -> ‘Manage Custom Definitions’ -> ‘Create Custom Dimensions’. Ensure the Event parameter name matches the parameter you’re sending from GTM, and give it a fitting description and display name.
After implementation, it might take a while for data to start populating within GA4. Monitor the results, and fine-tune if necessary. Finally, to generate the desired report, you might need to use the explore option in GA4 to display data according to the custom dimensions (editor name and published date). You can then compile the data as per your preference on the GA4 dashboard or your desired data visualization tool.
Given the complexity and detail of this process, you might consider hiring a GA4/GTM consultant or doing further research if any of the above steps are difficult to follow or not bringing the expected results. Remember to consistently test and validate the data being sent to GA4 to ensure that desired output is achieved. Good luck!
-
George
Member12 April 2023 at 11:28 am in reply to: Understanding Discrepancies in Event Counts between Google Analytics 4 and UADiscrepancies between GA4 and UA event counts, even with identical tags and triggers, can happen and are often due to the way these platforms process and count events. For instance, one finding suggests that GA4 might only show transactions that have a value for the field user_pseudo_id, which only appears in the BigQuery data export. Transactions where this field is null might not show up in the GA4 UI, leading to lower count compared to UA. This could potentially explain the discrepancy you’re seeing. Using BigQuery to look at raw event data is recommended for more accurate event counting.
-
George
Member7 April 2023 at 9:49 am in reply to: Optimizing Data Transfer from Google Analytics to Big Query for High Volume DataTo enable high throughput data transfer from Google Analytics to Big Query you’ll need Google Analytics 360, which removes the one-time export and daily import limits. It provides intraday updates and comes preconfigured to stream event data over. However, remember this comes at an additional cost.
-
George
Member2 February 2023 at 8:58 am in reply to: Is dataLayer.unshift() a suitable replacement for dataLayer.push() in GA4?Switching from push() to unshift() for adding elements to dataLayer shouldn’t disrupt Google Analytics 4’s ability to read the data as long as the data structure remains the same. While push() adds elements to the end of an array, unshift() adds them to the beginning. However, Google Analytics 4 doesn’t inherently depend on the order of elements in the dataLayer array; it’s much more concerned with the structure and naming convention of the data objects themselves. That being said, while such a change might not break anything, it could potentially make your code more confusing to maintain, potentially introducing bugs. Always test thoroughly when making changes like this.
-
George
Member1 February 2023 at 10:47 pm in reply to: Why are all my GA4 events being categorized as unassigned in channel grouping and (not set) in source/medium?This issue could be due to something as simple as a tracking code implemented the wrong way or more complex like an issue with how the website handles referrals. You can try a few things like checking if the tracking code’s installed correctly or if there are any redirects that might be wiping out the source information. Also, check your filters and settings as a wrong configuration could lead to ‘unassigned’ traffic in GA4. It’s trial and error, but one of these should help solve the problem.
-
George
Member14 August 2022 at 6:43 am in reply to: Troubleshooting Custom Dimension in Google Analytics with gtag set() MethodSure, here’s the gist of the situation:
The
gtag set
method doesn’t function as you might expect. It’s primarily useful for altering the DL for GTM’s benefit, but it doesn’t do much for setting properties. Nevertheless, you have alternatives.One method is to define the params directly within the event call, like this:
gtag("event", "Button click", {chain_id: "test id"});
.Please see this console snapshot for reference: [Console_Snapshot](https://i.stack.imgur.com/H2vhw.png)
Another method is to set the eps through the config, which will make them persist. See this snapshot for reference: [Event Snapshot](https://i.stack.imgur.com/8rt2o.png). However, please take note that Google recently updated for ignoring configs issued after the initial config. So, if you aim to modify persistent event parameters for all following events by issuing a config and gtag.js just disregards it, you might want to check out this discussion: [GA4_custom_dimensions_discussion](https://stackoverflow.com/questions/76177242/can-ga4-custom-dimensions-be-updated-after-the-initial-config-call/76222825#76222825)
In conclusion, I highly recommend you to consider using Google Tag Manager (GTM) or any other TMS. It simplifies the process of implementing, managing, scaling, and supporting tracking. Using gtag.js for tracking is practical when your tracking needs are minimal and it doesn’t affect your long-term business results.