Google Analytics Social Interactions via. gtag.js - google-analytics

Google Analytics documentation seems light on this topic, but historically businesses have been able to track social sharing interactions on their websites - 'Social Plugins' - via. both ga.js and analytics.js. See here: https://support.google.com/analytics/answer/1316556?hl=en
For use case example, as a business, an analyst would like to understand how often website content is shared onto social networks by website visitors.
The problem I'm having is, I can't easily find what the gtag.js equivalent is of this functionality. The closest I can find is to send a gtag event called 'share' - but not sure if this will populate the Social Report under Acquisition in Google Analytics.
Could anyone please advise how to track Social Interactions via. gtag.js for Google Analytics?
//ga.js
_gaq.push(['_trackSocial', network, socialAction, opt_target, opt_pagePath]);
> https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSocial
//analytics.js
ga('send', 'social', [socialNetwork], [socialAction], [socialTarget], [fieldsObject]);
> https://developers.google.com/analytics/devguides/collection/analyticsjs/social-interactions
Note: I found this website which website - https://www.balkanweb.com/peshq-te-barabarte-pavaresisht-nga-madhesia/ - which does seem to use gtag event 'share' function but I am just not sure if it populates the Social reports in GA as I can't see any documentation to support that.
gtag('event','share',{method:'twitter',event_action:'tweet',content_id:targetUrl})

I made a test and I confirm that the share event mentioned does not end up in the social report but in the event report.
Since the gtag.js documentation does not mention social hits (the parameter can only be: CONFIG, SET or EVENT) I believe there is currently no way to send that type of interactions from the website with gtag.

Sadly there is no way to translate this social hit type from UA (Universal Analytics) to GA4 (Google Analytics 4) directly.
The Universal Analytics to Google Analytics 4 migration guide (by Google) mentions this in the Hit types section of the document comparing the two:
Universal Analytics hit types include page hits, event hits, ecommerce hits, and social interaction hits.
In contrast, Google Analytics 4 data is event-based, with the principle that any interaction can be captured as an event. As such, Universal Analytics property hit types translate to events in a Google Analytics 4 property.
Further down the document it also says:
[...] it’s better to rethink your data collection in terms of the Google Analytics 4 model rather than port your existing event structure to Google Analytics 4.

Related

How to add Google universal analytics to Google analytics 4 only?

I have create a Google analytics 4 property and been running and gathering data for while now.
I need some external tools to integrate with it and I saw developers reporting that GA4 does not have an API yet, so it does not support any integrations.
I saw that you can create a dual UA and GA4 property but I was unable to find how to add UA to existing GA4 property.
In short: How do I add universal analytics view without loosing any data or integrate with external tools i.e. slack bot posting regular updates? (work around with big Query?)
GA4 does have an API. You can use the Google Analytics Data API v1 to fetch analytics data. The developer's site for this API has more information: https://developers.google.com/analytics/devguides/reporting/data/v1. The API is currently available at an Alpha (preview) stability. The API will be entering Beta shortly.
When you read about creating dual Property it means tracking with both GA4 and Universal Analytics separately. They are 2 different scripts that track data in different platforms with different model.
Therefore you can create a new Universal Analytics Property in your Google Analytics Account and insert that code in the pages of your site, however it will start tracking from that moment on, you cannot have the history, both because you cannot transport data from a Property to the another (even if they were 2 Properties of the same type), and because GA4 has a completely different data collection model.
In any case, from the moment you start tracking with Universal Analytics then you can query the data with the relative API (i.e. Analytics Reporting API).

How does google anayltics know about Google ads?

There is something quite basic that confuses me. I use Google ads conversion tracking with Google Tag Manager, and I don't understand how my google analytics know about these ads in the first place. I mean, the conversion tags I create in Google Tag Manager don't include the Google Analytics tracking code at all.
What am I missing?
Thanks
It knows based on the url structure of the incoming links.
This link gives a good overview.
UTM Codes: How to Track Campaign URLs in Google Analytics
This tool allows you to see how the different urls are built and decomposed in GA.
campaign-url-builder
Essentially the structure is integrated and google analytics logically decomposes and presents the data in a meaningful format based on URL.

Analytics for Firebase + Google tag manager + Google Analytics

I'm working with an app and I'm using Firebase , mostly for Analytics. This app also have a website, so what i want to do is sending my data that i'm collecting with Analytics for Firebase to some Property in Google analytics. Can i do this by Google Tag Manager?
The Flow will be something like this:
Firebase events -> Analytics for Firebase -> Google tag Manager -> Google Analytics
You should always start with a measurement plan that details the data you want to collect. This will help you report the performance of your business objectives and key performance indicators (KPIs) to your stakeholders. If you’re new to measurement planning, check out Analytics Academy for tips on how to create a solid measurement plan.
Then, you can install a basic implementation of Google Analytics via Tag Manager in four steps:
In Google Tag Manager, select ‘Create Tag’ and then choose the Google Analytics tag template.
Select ‘Universal Analytics’.
Configure your tag by naming it (it will default to the tag template name if you do not choose to change it). We suggest naming it "GA Pageview." Then add your Google Analytics property ID or your gaProperty variable. Finally, choose the Track Type, which in this case, should be the most common type of tracking: ‘Page View.’ A pageview tracks each time a browser loads a site page. Other types of tracking include Events, Cross-domain, Social, and Transaction and refer to the type of action you want to track on your website.
Choose your firing triggers. For a basic Google Analytics implementation, select ‘All Pages’. This means that the Google Analytics tag will fire, or execute, on every page of your site.
Google Tag Manager offers a variable type called “Google Analytics Settings” for use in Universal Analytics tags in web and mobile (Firebase) containers. A Google Analytics Settings Variable acts as a central location to configure sets of Google Analytics settings for use across multiple tags.
When you create a Google Analytics tag using Universal Analytics for web, iOS (Firebase), or Android (Firebase), you will be prompted to select or create a new Google Analytics Settings Variable.
Check this: https://analytics.google.com/analytics/academy/

Google Analytics Tracking Events

In our Google Analytics, we have a couple of events showing up that we have not set them up! By that, I mean, I haven't trigger those events from our website, neither through codes (ga.send('event')), nor through Google Tag Manager. I just can't figure out where they're populating from. To be specific, they're "Video" and "Livechat" events.
Is it possible that Analytics have ways of figuring some obvious events and track them for us?
Google Analytics does not send events on it's own. More likely scenarios are:
You are using third party integrations for video and livechat and
they include Google Analytics code that sends to your property (and
possibly others)
Someone else is using your tracking id in their site (you can check this by setting hostname as secondary dimension in your event reports)

How do I add Google Analytics cross domain tracking in Squarespace?

I have setup my site using Squarespace. I am also using Google Analytics to track site activity including eCommerce. When I go form product cart page to checkout page on my site it take we to following url secure.squarespace.com/commerce/checkout but during this process my old session is lost. In order to keep track of my existing client that is going from cart to checkout google analytics allow setting cross domain tracking between two distinct domain.
How can I set cross domain tracking in Squarespace? or Is there any way that my session activity is not lost and similar user is track between main site and Squarespace checkout pages. ?
Squarespace allow Google Analytics ecommerce tracking by embedded code, you just need to enter the google analytics id to start tracking, the embedded code belongs to classic google analytics and there is no way you can edit it (at least not in my knowledge) in order to modify allow linker command within code to enable cross domain tracking. I can use my own Google Analytics code or Google Tag Manager if preferred through code injection but for that I will have to remove the build in google analytics code (classic analytics) which will result in loss of ecommerce data.
I need to know if there is anyway to enable cross domain tracking within the embedded google analytics code or maybe use code injection and use my own Google Analytics code (remove the embedded) and still get ecommerce data for Google Analytics.

Resources