Google Tag Manager vs. Google Analytics - google-analytics

I'm attempting to learn how to incorporate Google Analytics and custom event tracking on a new website. After researching into it, I can't seem to understand the difference and relationship between Google Tag Manager and just writing custom event tracking code.
Is Google Tag Manager just an easier way to track information without having to write JS?

Yes - Google Tag Manager is a "Tag Management System" wherein you can implement a lot of tags external of a typical development release cycle.
Adding tags without efficient management prompts big problems. All that code bogs down your site. Redundant or incorrectly applied tags can distort your measurement and result in duplicate costs or missing data. And it can be time-consuming for the IT department or webmaster team to add new tags, which means important marketing and measurement programs can be delayed. With Google Tag Manager, you eliminate these problems—and run your campaigns when you need them. -- source
Marketing and tracking services provide “tags” — snippets of code you’re often asked to embed right before the end of your tag — and they’re relatively easy to use, but when more than a few tags are involved, managing them can be a tedious task. This is where Google’s new Tag Manager comes in, which consolidates all of your site’s tags into a single admin panel. Now, you only have to include one automatically-updated snippet on your site. -- source
A Tag Management System (TMS) is solution that controls the deployment of externally hosted Javascript "page tags", very similar to what a Content Management System does for content. Probably the most known tag-based application known is Google Analytics, but other apps include simple social media interactions such as the Facebook Like or Tweet This buttons to more complex systems such as the Intense Debate or Disqus comments systems. -- source
So in your question, you can implement google analytics via custom event tracking code or you can install google tag manager and then code all your custom google analytics event hooks in it.

The google analytics is for user tracking and website traffic analysis and statistics.
The Tag manager is to manage plugin to website like google analytics basically they are different.
You could add google analytics to your tag manager account and the only plugin you will add to your website it the tag manager
i have tried this already.
hoping this was helpful.
thanks (=

Let me share my experience of implementing custom event tracking with Google Tag Manager.
Goggles Tag Manager (GTM) is a layer between your website and Google Analytics (GA).
We can use GA code for event tracking but in this case we have to write JavaScript in the website code. We have to look for event and need to add GA code inside that event handler. Since we have updated code, now we have to wait for the code release cycle to make it available to live site.
Using GTM it is possible to handle custom event tracking without adding code to the website and we can test our implementation with GTM inbuilt debugger before deploying to production website, at anytime.
And there is one more design pattern where we can implement generic custom event tracking for the whole website without adding JavaScript, but adding data-attributes to links, buttons or div- what ever event we want to track just add your data-attributes to the link and those attributes will go to GTM trigger and if it matches the rule, that event will be tracked. This design pattern is good for any kind of generic custom event tracking. I have implemented custom click tracking number of times using this pattern, and I am happy with it.

Google Tag Manager makes tagging easy as it has quite a few builtin dom variables and event handlers for Click, Pageview, Custom Events etc.
It also allows you to manage various external vendors and sends them the data they need. (I.e., Facebook pixel)
It really is a great eco-system for non-developers to get involved in tagging and event tracking.

Related

Installing Google tag manager, google optimize and google analytics together on a website?

Recently I have been working on a project that requires GTM, GA & GO to be installed on a website.
Is there an optimal way to install all 3 onto the website without requiring copying of 3 individual code spinnets?
If we do require 3 individual code spinnets, What is the correct order to place the spinnets?
Not having to install multiple separate snippets is pretty much the point of a tag management system.
Create a Google Tag Manager Container and install the code snippet in the head of your page (that is the recommendation, but it will work pretty much everywhere else).
Then go to your container settings. In "Tags", click new. You will see tag templates for both Google Analytics (both Universal Analytics and GA4) and for Google Optimize (Documentation for Optimize with GTM is here, although it is slightly confusing). Basically you create a tag with the respective template, drop your tracking ids in, create a trigger that says when the tag will be executed and then publish your container.
You might want to have a look at the online courses Google offer for GTM: https://analytics.google.com/analytics/academy/course/5 to make best use of GTM.

Wix template sending tracking via fileusr to my site - causing Google Analytics to view traffic as referral

My website is hosted on wix.com . Wix does not allow you to insert HTML code directly in the page of your web site. When I input HTML code, Wix inserts an iframe that is hosted from a different domain (filesusr.com). This iframe does not use Google Analytics tracking, so when the browser loads this iframe GA believes my customer has "left" my web site and gone somewhere else. When the iframe loads, the original source of the traffic is lost.
From the research I've done, it seems this Wix feature does not work with GA traffic tracking, and so there is no solution other than using a different hosting platform.
However, I'm sure you clever folk know otherwise!...
Right, Wix is notorious for being a "widget" based platform that does not play nice with custom code. However, the whole GA different-origin thing is such a common request that they implement the tracker directly themselves if you plug your GA ID into your site settings. Any reason you are not using this? - https://support.wix.com/en/article/adding-your-google-analytics-tracking-id-to-your-wix-site. They also claim to support other custom tracking snippets - make sure you are pasting it into the "Tracking & Analytics" section and not as a custom HTML widget.
If for some reason you can't or don't want to use the above methods, it used to be that you were just out of luck. There is a reason why Wix is not as favored as other platforms by digital marketers that need to implement tracking code. However, if you were really determined, you could probably implement a very custom GA tracker or any custom code through their new feature called Corvid, which exposes internal APIs and extra coding features. How to do so is beyond the scope of this question, but the postMessage() method is the normal way to pass messages from a parent to a child (iframe) container. Or you could use wix-fetch, which is an internal version of the web API fetch(), to manually send a hit request to GA.

Google tag manager - multiple tags detected, is this correct?

I've just replaced my google analytics tag with a Google Tag manager installation integrated into GA. When I inspect my page with Google Tag assistant I see the installation of tag manager and 2 GA tags, is this correct?
I only have 1 GA property setup, is there a reason I'm seeing a second one?
There are many third-party widgets or plugins such as comment boxes or forms that use Google Analytics to track user interaction with their plugin. Considering the fact that the two Google Analytics Id's are from different accounts, this seems like a plausible reason.
To check this, copy the GA Id in question, view the page source, and search, (cmd+F) for the Id in the code. If this is the reason, the GA code will likely be embedded with the widget's code.

Is it OK (in google analytics) o have some pages with the GTM and others with analytics.js?

Per my answer here I have some pages using Google Tag Manager to report Google Analytics and some that report them directly using Analytics.js.
It seems to be working OK but I wanted to see if there were any issues I should be aware of.
You would need to make sure that whatever you are tracking with on-page code on those pages that don't have GTM are not already being tracked through GTM.
Generally speaking, it's not advisable to mix both GA and GTM on the same site (unless you are in the middle of migrating one to the other). So either go all GA, or all GTM (I usually always recommend going GTM). Otherwise there could be conflicts. It goes without saying that you should always test everything, too.

Track number of impressions of a widget running on a remote website

I have created a widget that is being hosted on a number of websites. I originally implemented the code using only jquery and JSONP to buid the widget. Upon implementing the widget on live webiste though we had the unfortunate experience of that other widgets which were on the site already had really poor javascript in them which killed our widget, so to cut a long story short I have created a second version which works using an IFrame. I have read up on the google analytics site that you can track usage in an IFrame fairly easily, but is there any way that I could track the usage of the original, iframeless version using Google Analytics. I could of course simply have an app on my side which counts the number of time the webservice I'm using to render the widget is called, and count the number of referrals on my site, but this seams like re-inventing the wheel when we already have Google Ananlytics to do this.
I don't think it's reinventing the wheel since Google Analytics is not designed to do this.
The advantage of having an iframe is that the content of the iframe is on your site, and thus under your control. With your plugin on the wild everything you do is shared with the global page namespace and in the same manner the other extension killed yours, your extension could have killed others.
If you implement analytics on your extension you could be impacting the site very heavily if it also uses Google Analytics.
Multiple trackers on a single page is tricky in Analytics. It's possible but not very well supported and not recommended by Google.
The problem happens when you have conflicting Google Analytics settings with the other trackers on the page. Since you're sharing the same cookies both tracker configurations must be compatible.
eg:
If one uses _setAllowHash and the other does not the cookies will be reset for each time a pageview is fired, possibly breaking both implementations pretty badly.
So if you have other means to track your extension go for it. Try to use Google Analytics only on your domain, so you're free to go if you're doing it inside your iframe, otherwise try to avoid it.
If you can update the other extensions that are out there, why not just replace it with the iframe versions of it?

Resources