Forum Replies Created

  • Abdul

    Member
    20 June 2023 at 9:01 pm in reply to: Implementing Separate Tracking in GA4 for Multiple Subdomains

    In GA4, the concept of ‘views’ like in Universal Analytics does not exist. Instead, data streams are used. However, everything is tracked in one single data stream and then users need to use filters in the reporting interface to view data for different sections of the website separately. To track different subdomains or directories of your site, you don’t need to create separate data streams. Just create one data stream for your entire domain http://www.xxxxx.com.

    To separate the data, you can create ‘Comparisons’ in your reporting. For example, if you want to see data for http://www.xxxxx.com/xxxxx only, you would create a comparison where ‘Page path’ starts with, ends with, or contains ‘/xxxxx’. Repeat this process for each of the directories. You can then save these comparisons to go back to them later.

    Additionally, you may find the GA4’s ‘Analysis’ section useful. In the Analysis section, you can create customized reports using dimensions (such as ‘Page path’) and metrics of your choice. Using the ‘Segment’ comparison feature, you can compare user behavior across different segments of your site.

    It’s a different way of thinking about your data compared to Universal Analytics, but once you get the hang of it, these tools can be quite powerful.

  • One solution could be to use Python, which excels in handling and parsing JSON data, to handle the complex parsing process. Firstly, you can write a script that reads the CSV file and the potentially nested JSON objects in each row. Python’s JSON module (json.loads) can convert JSON data into Python dictionaries, which is a format you can work with more easily. You can then transform the data and segregate it as needed, matching the target structure of your SQL Server tables. Lastly, use a Python SQL toolkit like SQLAlchemy to insert the data into your SQL server tables. You can also handle any issues with data conversion, formatting, and error checking before loading the data into SQL Server tables, making this approach more robust. Of course, remember to test this process on a smaller scale before running it on your full 1 million records data set.

  • Abdul

    Member
    15 June 2023 at 1:43 pm in reply to: Implementing User IDs in GTM and GA4

    To get a new userId everytime a user logs in, you need to replace the ‘1234567’ in your code with a variable that retrieves the userId from your system. This will differ based on your setup, but it’s often something like ‘window.user.id’ or ‘session.user.id’, where ‘user’ is the logged in user data and ‘id’ is their unique identifier. Basically, this variable should point to where your system keeps track of the logged-in user’s ID. Once this is setup, everytime a user logs in, the correct ID will be sent to Google Tag Manager.

  • Sometimes, difficulties with Google Analytics 4 (GA4) events like “view_item” can occur even when everything seems to be correctly set in the code of your BigCommerce page. It’s strange that despite the event data appearing fine in the source code, you’re not seeing any related data in the GA4 Debug View, nor in the Network tab in Chrome Dev Tools.

    One possibility could be that there might be an underlying issue in the way your events are being logged or communicated to GA4. It’s also possible that some sort of caching issue or a problem with the GA4 Debug View is preventing you from seeing the event. Other than these, it might be harder to pinpoint the problem without more detailed debugging or deeper analysis of your GA4 setup.

    Remember, despite being a little frustrating, such bumps are quite common when setting up or modifying tracking events, be patient and methodically work it out.