Google analytics code example. For example to set the expiration of the visitor cookie to 7 days you would use the following code. Sets the google analytics visitor cookie expiration in milliseconds. The google analytics tag.
It also allows you to easily update and add tags to your google analytics code without having to manually write code on the back endsaving you time and a lot of headaches down the. The google analytics tracking code also reads the doubleclick cookie to get information about the display features. For example track downloads video plays and blog subscriptions as google analytics events.
The way it works is simple. Check out googles help center for more information about the anatomy of an event. There are many more types of code that can be added to your website using gtm including custom codes.
Some good examples of a tag would be google analytics tracking code google analytics event codes google ads conversion script and remarketing tags. The analyticsjs library also known as the google analytics tag is a javascript library for measuring how users interact with your website. To use google tag manager to install your global site tag read the google tag manager setup and installation guide.
From google analytics you are also able to understand how people interact with your wordpress site for example the links they click on. As a user navigates between web pages google analytics provides website owners javascript tags libraries to record information about the page a user has seen for example the url of the page. This document explains how to add the google analytics tag to your site.
Input your desired category action label and value into the google analytics event tracking code generator to receive your custom snippet. Google tag manager does not replace google analytics. Google analytics is a simple easy to use tool that helps website owners measure how users interact with website content.
Google tag manager is a free tool to help add and manage multiple analytics and site tracking tags. By default the visitor cookie is set to expire in 2 years. If you define certain goals like converting visitors to email subscribers you can also track that.
Google tag manager takes all the data on your website and sends it to other platforms such as facebook analytics and google analytics.