

Jackson
Forum Replies Created
-
Jackson
Member9 July 2023 at 12:21 am in reply to: Implement drag and drop event tracking in Google Tag ManagerYou can track drag and drop actions by leveraging the HTML5 Drag and Drop API, using JavaScript, and Google Tag Manager. You’ll need to write custom JavaScript code that listens for the relevant drag and drop events, such as ‘dragstart’ and ‘drop’. Once an event is detected, your script can push the relevant information (like the object ID that was dragged and the drop coordinates) to the dataLayer. Then, in Google Tag Manager, you can create a custom event trigger that fires when these events are pushed to the dataLayer. Finally, create a tag to send these events to GA4. Make sure your JavaScript code is properly connected to your web page, and remember to always test your configuration in Google Tag Manager before deploying it.
-
Jackson
Member27 June 2023 at 11:25 am in reply to: Understanding the Coexistence of Google Analytics 4 Scripts for Analytics and Tag ManagerSure, here’s a more casual walkthrough of your questions:
Scripts on the Site
You can choose either the first script OR the second and third ones. I tend to not use the third one anymore, because it’s more of a backup for users who don’t have JavaScript enabled.
However, be cautious about using both the first and second script together, as it might result in duplicate data.
Different Scripts Explained
The first script you’re referring to is the Google Tag (gtag.js). It’s more of a basic or simpler form of Google Tag Manager (GTM).
The other one is GTM itself. Now, GTM isn’t just a plug and play script. It’s a tag management system and you need to properly configure it. That means, you need to manually add a GA4 “tag” to start collecting data.
Linking Accounts
No worries, you don’t necessarily have to use the same Google account for GA and GTM. But for simplicity, it does help to use the same account if you’re the only one accessing it. I’ve personally managed GTM “containers” without having access to the corresponding GA4 accounts and vice versa.
Viewing Data
In GA4, you won’t be able to see today’s data except in the Realtime view. If you’d like to see your own events immediately, try using the Debug Mode to see them in the Debug View. If you need more insights, you could link Big Query to your GA4 property which allows you to see “traffic” in the intraday table/database. Just keep in mind, all data is subject to Google Analytics’ rules on data freshness.
-
Jackson
Member20 June 2023 at 11:14 pm in reply to: Understanding the permission error in Google Analytics Admin API.The
PermissionDenied: 403 The caller does not have permission error
occurs because the service account you’re using doesn’t have the necessary permissions. This error can occur even if you’ve assigned full owner permissions to the service account. The Google Analytics API relies on a different set of permissions which need to be assigned within the Google Analytics Admin Console.You need to add the service account email to the user management section in the Admin Console of the Analytics account you are trying to access. In that User Management, you’ll want to ensure you’ve provided ‘Read & Analyze’ access at a minimum and if you need to manage other aspects of the account, you may need additional permissions.
The blank list results from
client.list_accounts()
also suggests that the service account doesn’t have permission to view any accounts.Please note that each of your Google Analytics accounts (UA or GA4) will have to be individually shared with the service account’s email for it to be able to access them via the API.
And please ensure you have the latest Google analytics libraries installed properly. If you have previous versions you might run into compatibility issues which can cause permission issues as well.
As you’ve mentioned you’ve multiple Google Analytics account under same google account, make sure you are trying to get data for the accounts for which your service account has proper permissions. Check that the service account key you are using is for the same project in which the Google Analytics API is enabled.
-
Jackson
Member8 June 2023 at 5:24 pm in reply to: Finding documentation for GA4 page_view event in Google AnalyticsAll of these basic events (“page_view”, “event”, “timing”, and “exception”) are thoroughly detailed on the Google Developers site, particularly in the Google Analytics and Google Tag Manager sections. A ‘page_view’ is sent whenever a person views a page on your website. ‘Event’ is a general category that encompasses user interactions with content that can be tracked independently from a web page or screen load. The ‘timing’ event is used to send timing data to Google Analytics, typically loading times or other time related data. The ‘exception’ event is used to measure unhandled JavaScript exceptions or other errors that may occur on your site. Please refer to the official documents for more detailed information about these basic events.
-
Jackson
Member27 May 2023 at 7:42 pm in reply to: How can I track hover events for multiple elements in this code?Sure, I can surely point you in the right direction. For your first problem, the code is actually capable of tracking more than one image at a time. The ‘selector’ parameter in the function can accept multiple selectors separated by commas. So, instead of just one class, you could send in multiple like ‘img.afg-celebrate, img.anotherClass, img.yetAnotherClass’.
Your second problem is a bit tricky but not impossible to solve either. The ‘alt’ text can indeed be used to select an element. Just like we used classes for selection, we can use attributes like ‘alt’. However, you’ll have to know the exact ‘alt’ text to select the correct element. The selector could look like this: ‘img[alt=”Your Alt Text”]’. Make sure to replace ‘Your Alt Text’ with the actual alt text of the image you’re trying to track. Happy coding!
-
Your interpretation of the GA4 metrics seems mostly correct, although it is always important to consider their context in actual usage. The metrics you found later (campaignName, source, medium, manualAdContent, manualTerm) are dimension items usually associated with a specific event (like page_view or ad_click), whereas session prefixed dimensions (sessionCampaignName, sessionSource, sessionMedium, etc.) are associated with user-level or session-level data, rather than event-level data.
Coming to the Multi-Channel Funnels Reporting API, unfortunately, GA4 does not support Multi-Channel Funnel reports in the same way as Universal Analytics. Instead of using the Multi-Channel Funnels Reporting API from Universal Analytics, GA4 proposes to use the new ‘Conversion Paths’ report, accessible in GA4 interface, although it doesn’t have an API as of now. However, while this may not exactly have the flexibility and sophistication of the Multi-Channel Funnel API, it does provide a way to explore user conversion paths similar to the Multi-Channel Funnel Reports.
-
Jackson
Member7 March 2023 at 6:49 am in reply to: Implementing GA4 event tracking in a Laravel App: How to use measurement protocol?Sounds like you’re moving from Universal Analytics to GA4. It’s kinda tricky because GA4 uses a whole new system based on events, instead of sessions or pageviews. Libraries that worked with UA may not be compatible with GA4 yet. Without seeing the code I can’t really help with specifics, but in general, you’ll need to switch to a library or method that supports GA4, or directly use the Measurement Protocol API provided by Google.
-
Jackson
Member28 September 2022 at 4:04 am in reply to: How to Integrate Google Analytics 4 into a .pug TemplateYou’re trying to integrate Google Analytics 4 with a .pug template file and despite following the instructions, you’re receiving a notice that Google Analytics isn’t collecting any data. In essence, it sounds like the code you’ve implemented has not activated Google Analytics on your website. This could be due to a variety of reasons. It could be that the code you’ve implemented isn’t firing correctly, or there may be an issue with the settings in your Google Analytics account. It would be beneficial to verify that the Google Analytics ID you have used in your code is correct. Additionally, do more checks with different tools to validate that the GA code is not firing. Sometimes, it might take some time for the data to start appearing in the GA console so ensure that you have waited for enough time as well. If the problem persists, consider reaching out to a professional developer to look at your problem, perhaps there’s something you might have overlooked considering this is a new territory for you.