Enable Datalayers for Hubspot with GTM - google-tag-manager

Is there any way to enable Data layers in a website (built-in Hubspot) with GTM?
Is there any article or tool?

If you already deployed GTM on the site, then you have it. GTM deploys dataLayer automatically. You can check it in the dev console.
If you need to push certain things into it, Hubspot lists its globally accessible variables to be used here but you can as well just use them without dataLayer since GTM has all the JS presence needed to grab those variables from the global scope.
And here is an example of pushing the data from hubspot to the dataLayer.

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.

Integrating GTM with Shopify

I have read from the documentation that GTM can be integrated on Shopify Plus stores. However, I have also read that from blogs that they can also integrate GTM on Shopify Standard stores.
So what is the difference between Plus and Standard in terms of GTM integration?
Another topic I want to know is how to use GTM to control the GA the hits from the Shopify GA Integration. Because I believe if I setup the GA Code in Shopify Settings and setup the GTM script, the GA code still fires hits to GA and GTM will just handle any other dataLayer and events. I cannot control the enhanced ecommerce and pageview hits with GTM.
Edited:
I just got in touch with Shopify Support, and the reason why they say that GTM is only available on Plus stores, is because Plus stores have access to the checkout.liquid which is required to integrate GTM on the checkout page for the whole site to work with GTM. Standard stores will not have GTM on checkout page.
GTM integration is the same in Plus stores as in Standar stores. Paste your code in the beginning of the head and the begging of the body.
If you add GTM in the code, I would suggest removing the GA code in the Shopify preferences and adding it to your GTM to have full control of all triggers and events.

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.

Google Tag Manager vs. 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.

Resources