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

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.

Related

How to create a Google Analytics report on a specific query string?

I have hunted around a bit and only found how to setup the site search parameter in a site's admin section. This is not what I want. Also looked through some Google Search Console videos - no go.
Given a URL, https://somesite.com/redirect/?redirect=https://gofundme.com/somecampaign/.
As some background, what I have setup here is a simple page that says "Loading..." and is used for external links I want to track analytics on, from platforms that I may not have access to the link's analytics. For example: https://gofundme.com/somecampaign.
Rather than having a redirect setup on the page itself, I injected custom JavaScript through Google Tag Manager that records analytics data in Google Universal Analytics (anyone want to recommend how to do this in G4A?) then performs the redirect.
My question is, in Google Analytics, how do I setup a custom report where the query string parameter = redirect and/or the specific page URL?
Thanks.

Google Analytics Social Interactions via. gtag.js

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.

Tag Manager - Enhanced ecommerce

I am trying to set up Enhanced E-commerce tracking for a hotel booking site. The site uses a third party for booking and taking payments.
The booking site have implemented the data layer.
But the data is not getting transferred to Google Analytics.
This is what I have done so far. Can anyone tell me what I am doing wrong?
Added a universal analytics tag.
Added a custom event trigger with the name supplied by booking site
Created a variable with data layer and Enhanced E-commerce enabled.

The importance of _gl parameter for cross domain tracking when you have Google Analytics installed

I have a website and its booking engine (2 different domains) at work and visitors land on the website and then proceed to the booking engine.
I have installed Google Analytics correctly to measure conversions that take place in the booking engine domain. Everything getting recorded correctly in Google Analytics account.
We recently launch Google Ads campaign and I saw that there is another parameter named '_gl' needed to append to the booking engine URL when a visitor proceeds to the booking engine via the website for correct cross domain tracking (probably to avoid Safari tracking prevention).
Just wanted to know, how important this _gl parameter for cross domain tracking since I already have correct Google Analytics setup in place and have linked Google Analytics and Ads accounts.
Thank you!
The parameter you mention is very important in order to correctly track users between two domains, otherwise GA cannot link the same user when they browse from one domain to another.

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/

Resources