{"id":26147,"date":"2020-09-30T00:00:00","date_gmt":"2020-09-29T22:00:00","guid":{"rendered":"https:\/\/blexin.com\/google-analytics\/"},"modified":"2021-05-20T18:22:39","modified_gmt":"2021-05-20T16:22:39","slug":"google-analytics","status":"publish","type":"post","link":"https:\/\/blexin.com\/en\/blog-en\/google-analytics\/","title":{"rendered":"Google Analytics &lt;3 Angular"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"608\" data-attachment-id=\"26078\" data-permalink=\"https:\/\/blexin.com\/en\/?attachment_id=26078\" data-orig-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/image00-1.png?fit=1024%2C608&amp;ssl=1\" data-orig-size=\"1024,608\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image00\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/image00-1.png?fit=1024%2C608&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/image00-1.png?resize=1024%2C608&#038;ssl=1\" alt=\"\" class=\"wp-image-26078\" srcset=\"https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/image00-1.png 1024w, https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/image00-1-980x582.png 980w, https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/image00-1-480x285.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">As part of the development of an e-commerce platform, which a front-end has been developed with Angular 8, the customer asked us to track user activities, using Google Analytics, in order to have live statistics on products sold on the site.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Google Analytics is undoubtedly the best-known tracking product, and it offers several ways to track user visits on a website, time spent by users on each page and actions that he performs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Tracking user activities is necessary for most companies in the world as it helps to provide valuable data to create effective marketing campaigns and improve the user experience.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Another feature is the monitoring of loading times and the accessibility of the site&nbsp;so that a developer could optimize his Web application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Google Analytics was designed for multi-page applications, as it calculates the number of views by tracking the user&#8217;s navigation from one page to another.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Angular, on the other hand, is a framework for single-page applications (SPA), which means that the browser technically only loads one page and, whenever a page &#8220;changes&#8221;, the DOM is simply updating parts of it, by changing the components that form it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So, even if the link in the address bar changes dynamically, we are always on the same page, and Google Analytics naturally cannot know &#8211; in its basic implementation &#8211; that we are on a different view.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before starting the integration, we must register our application with Google Analytics and obtain a tracking ID. We go to the Google Analytics web page and log in with our Google credentials.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A drop-down menu will appear and we can click on the &#8220;Analytics&#8221; link.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"501\" data-attachment-id=\"26085\" data-permalink=\"https:\/\/blexin.com\/en\/?attachment_id=26085\" data-orig-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/09\/immagine1.png?fit=2771%2C1356&amp;ssl=1\" data-orig-size=\"2771,1356\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"immagine1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/09\/immagine1.png?fit=1024%2C501&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/09\/immagine1.png?resize=1024%2C501&#038;ssl=1\" alt=\"\" class=\"wp-image-26085\" srcset=\"https:\/\/blexin.com\/wp-content\/uploads\/2020\/09\/immagine1-980x480.png 980w, https:\/\/blexin.com\/wp-content\/uploads\/2020\/09\/immagine1-480x235.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Once logged in, we can fill the registration form with the details of the web application;&nbsp;then we must accept the terms and conditions and finally click the &#8220;Get Tracking ID&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"438\" data-attachment-id=\"26087\" data-permalink=\"https:\/\/blexin.com\/en\/?attachment_id=26087\" data-orig-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine2.png?fit=2785%2C1190&amp;ssl=1\" data-orig-size=\"2785,1190\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"immagine2\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine2.png?fit=1024%2C438&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine2.png?resize=1024%2C438&#038;ssl=1\" alt=\"\" class=\"wp-image-26087\" srcset=\"https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine2-980x419.png 980w, https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine2-480x205.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We are led back to the dashboard where we can see our tracking ID, which we will use in our application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the administration section Tracking Info -&gt; Tracking Code, we can obtain the javascript code to insert in our pages. It contains a link to an external file and the definition of the gtag () function, which is the main function for the integration of Google Analytics with others&#8217; frameworks.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"545\" data-attachment-id=\"26090\" data-permalink=\"https:\/\/blexin.com\/en\/?attachment_id=26090\" data-orig-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine3.png?fit=2631%2C1401&amp;ssl=1\" data-orig-size=\"2631,1401\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"immagine3\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine3.png?fit=1024%2C545&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine3.png?resize=1024%2C545&#038;ssl=1\" alt=\"\" class=\"wp-image-26090\" srcset=\"https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine3-980x522.png 980w, https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine3-480x256.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The code in the Global Site Tag section (gtag.js) must be inserted in the index.html file, as the last element of the head tag.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this way, we can use the gtag () function in our entire Web application according to our needs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As mentioned above, our Angular applications run within a page, and, in order to properly monitor pages through Google Analytics, we need to know the URL that the user navigates to without loading a new page.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To obtain the URL, we can subscribe to the router events and check if they are of type NavigationEnd and, if so, invoke gtag() passing the urlAfterRedirects property of the subscribed event as a parameter.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The call to gtag (), specifically gtag (&#8216;config&#8217;, &#8216;[Tracking Id]&#8217;, { \u2018page_path\u2019: \u2018[url]\u2019}), records that the user has viewed the page at that URL.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To have a first (and certainly faster) integration of Google Analytics, which will allow us to track the user&#8217;s URLs, we can insert the instructions just typed in app.component.ts, since it is the main application file which is loaded at the highest level. Our app.component.ts file will look like this:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nimport{Router, NavigationEnd} from &#039;@angular\/router&#039;;\n \ndeclare let gtag: Function;\n \nexport class AppComponent {\n constructor(public router: Router){ \n this.router.events.subscribe(event =&gt; {\n if(event instanceof NavigationEnd){\n gtag(&#039;config&#039;, &#039;xx-xxxxx-xx&#039;,\n  {\n &#039;page_path&#039;: event.urlAfterRedirects\n  }\n );\n  }\n  }\n  )}\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">There are other parameters we can use to further enrich the tracking stats. The list of all parameters is available on the official documentation page (<a href=\"https:\/\/developers.google.com\/analytics\/devguides\/collection\/gtagjs\/pages\">https:\/\/developers.google.com\/analytics\/devguides\/collection\/gtagjs\/pages<\/a>).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Another fundamental feature of Google Analytics is the tracking of events, which adds an additional layer of data to the Analytics statistics.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To make the integration consistent and reduce the amount of duplicate code in our application, we can create an Angular service to use in our components.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Through the Angular CLI we can generate a service and add it to app.module.ts with the instruction:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>ng generate s GoogleAnalytics<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Our app.module.ts will be:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nimport {GoogleAnalyticsService} from &#039;.\/google-analytics.service&#039;;\n...\n@NgModule({\n providers: &#x5B;GoogleAnalyticsService],\n});\nexport class AppModule { }\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Inside GoogleAnalyticsService, we create an eventEmitter public function that will essentially run gtag() making sure the formatting is correct.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Of course, we must declare the gtag() function in order to expose the service to the outside.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Our GoogleAnalyticsService will look like:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\ndeclare let gtag:Function;\nexport class GoogleAnalyticsService {\n public eventEmitter( \n eventName: string, \n eventCategory: string, \n eventAction: string, \n eventLabel: string = null, \n eventValue: number = null ){ \n gtag(&#039;event&#039;, eventName, { \n eventCategory: eventCategory, \n eventLabel: eventLabel, \n eventAction: eventAction, \n eventValue: eventValue\n  })\n  }\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">We created the GoogleAnalyticsCartService service which is a wrapper for GoogleAnalyticsService:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nexport class GoogleAnalyticsCartService {\npublic addToChart(productId) {\nthis\n .googleAnalyticsService\n .eventEmitter(\u2018add_to_cart\u2019, \u2018shop\u2019, \u2018cart\u2019, \u2018click\u2019, productId);\n  }\n \npublic removeFromChart(productId) {\nthis\n .googleAnalyticsService\n .eventEmitter(\u2018remove_from_cart\u2019, \u2018shop\u2019, \u2018cart\u2019, \u2018click\u2019, productId);\n  }\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">To use this service, we need to import it into the component and run it when something happens (like a button click event) and pass the values \u200b\u200bwe want to monitor to the eventEmitter for execution.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In our implementation, we used the eventEmitter function to track the following events:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>adding product to cart;<\/li><li>elimination of product from the cart.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">We have created a component named ShopComponent that manages the addition of a product<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the case of addition of a product to the cart, we have a button that calls the SendAddToCartEvent function passing the product id as an argument.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n&lt;button (click)=&quot;SendAddToCartEvent(productId)&quot;&gt;Add To Cart&lt;\/button&gt;\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">And, in our component, we handle SendAddToCartEvent to call the eventEmitter function defined earlier.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n.\nimport{GoogleAnalyticsCartService} from &#039;.\/google-analytics-cart.service&#039;;\n \nexport class ShopComponent implements OnInit {\n \n constructor(\n public googleAnalyticsCart: GoogleAnalyticsCartService\n  )\n \n SendAddToCartEvent(productId){ \n this\n .googleAnalyticsCart\n .addToCart(productId);\n } \n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">In the same way, the events of elimination of a product from the cart will be managed through the eventEmitter function:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nSendRemoveFromCartEvent(productId){ \n this\n .googleAnalyticsCart\n .addToCart(productId);\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Another feature offered by Google Analytics is the user tracking.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In order to filter events and page views by user, the User-ID must be enabled in the Analytics configuration panel.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"545\" data-attachment-id=\"26098\" data-permalink=\"https:\/\/blexin.com\/en\/?attachment_id=26098\" data-orig-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine3-1.png?fit=2631%2C1401&amp;ssl=1\" data-orig-size=\"2631,1401\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"immagine3-1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine3-1.png?fit=1024%2C545&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine3-1.png?resize=1024%2C545&#038;ssl=1\" alt=\"\" class=\"wp-image-26098\" srcset=\"https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine3-1-980x522.png 980w, https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine3-1-480x256.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Once the User-ID is enabled, the current user can be configured in our Angular application, just by using:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\ngtag(\u2018set\u2019, \u2018userId\u2019, userid)\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">where userid is a string that uniquely represents the system user.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">At the time of user login, it is advisable to retrieve a parameter, such as an index or guid (not personal information such as name, email, address) and set it as userId.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As for event management, we have created a wrapper method to configure the user:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\npublic setCurrentUser(userId: string){ \n gtag(&#039;set&#039;, \u2018userId\u2019, userId);\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">that will be used in the component named LoginComponent:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nimport{GoogleAnalyticsService} from &#039;.\/google-analytics.service&#039;;\n \nexport class LoginComponent implements OnInit {\n \n constructor(\n &#x5B;...]\n public googleAnalytics: GoogleAnalyticsService\n  )\n \n login(username, password){\n &#x5B;\u2026] \n var userId = this.http...\n this\n .googleAnalytics\n .setCurrentUser(userId);\n } \n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Google Analytics also allows us to check whether the operations on our Web application have been carried out within a user session or not.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Through the menu Audience -&gt; Behavior -&gt; User-ID Coverage, it is possible to obtain the data of the operations carried out by Assigned (logged in and tracked) and Unassigned (not logged in) users.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"504\" data-attachment-id=\"26102\" data-permalink=\"https:\/\/blexin.com\/en\/?attachment_id=26102\" data-orig-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine5.png?fit=2821%2C1388&amp;ssl=1\" data-orig-size=\"2821,1388\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"immagine5\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine5.png?fit=1024%2C504&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine5.png?resize=1024%2C504&#038;ssl=1\" alt=\"\" class=\"wp-image-26102\" srcset=\"https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine5-980x482.png 980w, https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine5-480x236.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To view the operations filtered by the user, however, you need to create a view.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the Tracking Info -&gt; UserID menu, once the settings (User-ID policy and Session Unification) have been configured, we can create a view.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"462\" data-attachment-id=\"26104\" data-permalink=\"https:\/\/blexin.com\/en\/?attachment_id=26104\" data-orig-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine6.png?fit=2777%2C1252&amp;ssl=1\" data-orig-size=\"2777,1252\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"immagine6\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine6.png?fit=1024%2C462&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine6.png?resize=1024%2C462&#038;ssl=1\" alt=\"\" class=\"wp-image-26104\" srcset=\"https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine6-980x442.png 980w, https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine6-480x216.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In this way, for each operation performed by users, it will be possible, via the Google Analytics panel, to filter the operations by user.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"408\" data-attachment-id=\"26107\" data-permalink=\"https:\/\/blexin.com\/en\/?attachment_id=26107\" data-orig-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine7_1.png?fit=2800%2C1116&amp;ssl=1\" data-orig-size=\"2800,1116\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"immagine7_1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine7_1.png?fit=1024%2C408&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine7_1.png?resize=1024%2C408&#038;ssl=1\" alt=\"\" class=\"wp-image-26107\" srcset=\"https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine7_1-980x391.png 980w, https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine7_1-480x191.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The example project attached to this article is a simple e-commerce Web application, with a list of static products that can be added to the cart, and another cart used to manage the products (increasing or decreasing the quantity).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We can run it by typing:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nng serve --watch\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">and browsing on <a href=\"http:\/\/localhost:4200\" rel=\"nofollow\">http:\/\/localhost:4200<\/a>, we get the dashboard:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"452\" data-attachment-id=\"26109\" data-permalink=\"https:\/\/blexin.com\/en\/?attachment_id=26109\" data-orig-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/Immagine8_1.png?fit=2864%2C1265&amp;ssl=1\" data-orig-size=\"2864,1265\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Immagine8_1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/Immagine8_1.png?fit=1024%2C452&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/Immagine8_1.png?resize=1024%2C452&#038;ssl=1\" alt=\"\" class=\"wp-image-26109\" srcset=\"https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/Immagine8_1-980x433.png 980w, https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/Immagine8_1-480x212.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">by clicking on the name of the product, a detail page opens, whether by clicking on Add To Cart, the product is added to the cart.<br>By clicking on the cart icon at the top right, we can manage the quantities of products or remove them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once performed enough actions on our site, we can go to the Google Analytics panel to view the statistics of those actions.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"513\" data-attachment-id=\"26112\" data-permalink=\"https:\/\/blexin.com\/en\/?attachment_id=26112\" data-orig-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine9.png?fit=2805%2C1404&amp;ssl=1\" data-orig-size=\"2805,1404\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"immagine9\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine9.png?fit=1024%2C513&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine9.png?resize=1024%2C513&#038;ssl=1\" alt=\"\" class=\"wp-image-26112\" srcset=\"https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine9-980x491.png 980w, https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine9-480x240.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To show the events, instead, we can go to Behavior-&gt; Events, and from there filter by type of event, product id. and, of course, user id.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"485\" data-attachment-id=\"26114\" data-permalink=\"https:\/\/blexin.com\/en\/?attachment_id=26114\" data-orig-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine10.png?fit=2804%2C1327&amp;ssl=1\" data-orig-size=\"2804,1327\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"immagine10\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine10.png?fit=1024%2C485&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine10.png?resize=1024%2C485&#038;ssl=1\" alt=\"\" class=\"wp-image-26114\" srcset=\"https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine10-980x464.png 980w, https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/immagine10-480x227.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In this article, we showed you how to integrate Google Analytics into Angular projects to obtain stats and site events.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We wish we raised your interest in the topic.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The sample project with the code used in this article is available&nbsp;<a href=\"https:\/\/github.com\/enricobencivenga\/AngularGoogleAnalytics\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">See you at the next article!<\/p>\n\n\n[et_pb_section global_module=\"26155\"][\/et_pb_section]\n\n\n[et_pb_section global_module=\"26259\"][\/et_pb_section]\n","protected":false},"excerpt":{"rendered":"<p>How to integrate Google Analytics into our Angular Web Apps<\/p>\n","protected":false},"author":196716247,"featured_media":26078,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"off","_et_pb_old_content":"","_et_gb_content_width":"","_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","inline_featured_image":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_wpcom_ai_launchpad_first_post":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"{title}\n\n{excerpt}\n\n{url}","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_wpas_customize_per_network":false,"jetpack_post_was_ever_published":false},"categories":[688637524],"tags":[688637390,688637392],"class_list":["post-26147","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog-en","tag-angular-en","tag-web-en"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Google Analytics &lt;3 Angular - Blexin<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blexin.com\/en\/blog-en\/google-analytics\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Google Analytics &lt;3 Angular - Blexin\" \/>\n<meta property=\"og:description\" content=\"How to integrate Google Analytics into our Angular Web Apps\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blexin.com\/en\/blog-en\/google-analytics\/\" \/>\n<meta property=\"og:site_name\" content=\"Blexin\" \/>\n<meta property=\"article:published_time\" content=\"2020-09-29T22:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-20T16:22:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i2.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/image00-1.png?fit=1024%2C608&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"608\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Enrico Bencivenga\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Enrico Bencivenga\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/google-analytics\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/google-analytics\\\/\"},\"author\":{\"name\":\"Enrico Bencivenga\",\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/#\\\/schema\\\/person\\\/74e4443d1d7ad12d5b4a8db7f63f0194\"},\"headline\":\"Google Analytics &lt;3 Angular\",\"datePublished\":\"2020-09-29T22:00:00+00:00\",\"dateModified\":\"2021-05-20T16:22:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/google-analytics\\\/\"},\"wordCount\":1308,\"image\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/google-analytics\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/blexin.com\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/image00-1.png?fit=1024%2C608&ssl=1\",\"keywords\":[\"Angular\",\"Web\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/google-analytics\\\/\",\"url\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/google-analytics\\\/\",\"name\":\"Google Analytics &lt;3 Angular - Blexin\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/google-analytics\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/google-analytics\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/blexin.com\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/image00-1.png?fit=1024%2C608&ssl=1\",\"datePublished\":\"2020-09-29T22:00:00+00:00\",\"dateModified\":\"2021-05-20T16:22:39+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/#\\\/schema\\\/person\\\/74e4443d1d7ad12d5b4a8db7f63f0194\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/google-analytics\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/google-analytics\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/google-analytics\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/blexin.com\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/image00-1.png?fit=1024%2C608&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/blexin.com\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/image00-1.png?fit=1024%2C608&ssl=1\",\"width\":1024,\"height\":608},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/google-analytics\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/blexin.com\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Google Analytics &lt;3 Angular\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/blexin.com\\\/en\\\/\",\"name\":\"Blexin\",\"description\":\"Con noi \u00e8 semplice\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blexin.com\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/#\\\/schema\\\/person\\\/74e4443d1d7ad12d5b4a8db7f63f0194\",\"name\":\"Enrico Bencivenga\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ea7187309674789d6f02c6b757e1f21c8cf800abb2419b4edaa8b09d4c99548?s=96&d=identicon&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ea7187309674789d6f02c6b757e1f21c8cf800abb2419b4edaa8b09d4c99548?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ea7187309674789d6f02c6b757e1f21c8cf800abb2419b4edaa8b09d4c99548?s=96&d=identicon&r=g\",\"caption\":\"Enrico Bencivenga\"},\"url\":\"https:\\\/\\\/blexin.com\\\/en\\\/author\\\/enrico-bencivengablexin-com\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Google Analytics &lt;3 Angular - Blexin","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blexin.com\/en\/blog-en\/google-analytics\/","og_locale":"en_US","og_type":"article","og_title":"Google Analytics &lt;3 Angular - Blexin","og_description":"How to integrate Google Analytics into our Angular Web Apps","og_url":"https:\/\/blexin.com\/en\/blog-en\/google-analytics\/","og_site_name":"Blexin","article_published_time":"2020-09-29T22:00:00+00:00","article_modified_time":"2021-05-20T16:22:39+00:00","og_image":[{"width":1024,"height":608,"url":"https:\/\/i2.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/image00-1.png?fit=1024%2C608&ssl=1","type":"image\/png"}],"author":"Enrico Bencivenga","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Enrico Bencivenga","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blexin.com\/en\/blog-en\/google-analytics\/#article","isPartOf":{"@id":"https:\/\/blexin.com\/en\/blog-en\/google-analytics\/"},"author":{"name":"Enrico Bencivenga","@id":"https:\/\/blexin.com\/en\/#\/schema\/person\/74e4443d1d7ad12d5b4a8db7f63f0194"},"headline":"Google Analytics &lt;3 Angular","datePublished":"2020-09-29T22:00:00+00:00","dateModified":"2021-05-20T16:22:39+00:00","mainEntityOfPage":{"@id":"https:\/\/blexin.com\/en\/blog-en\/google-analytics\/"},"wordCount":1308,"image":{"@id":"https:\/\/blexin.com\/en\/blog-en\/google-analytics\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/image00-1.png?fit=1024%2C608&ssl=1","keywords":["Angular","Web"],"articleSection":["Blog"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/blexin.com\/en\/blog-en\/google-analytics\/","url":"https:\/\/blexin.com\/en\/blog-en\/google-analytics\/","name":"Google Analytics &lt;3 Angular - Blexin","isPartOf":{"@id":"https:\/\/blexin.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blexin.com\/en\/blog-en\/google-analytics\/#primaryimage"},"image":{"@id":"https:\/\/blexin.com\/en\/blog-en\/google-analytics\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/image00-1.png?fit=1024%2C608&ssl=1","datePublished":"2020-09-29T22:00:00+00:00","dateModified":"2021-05-20T16:22:39+00:00","author":{"@id":"https:\/\/blexin.com\/en\/#\/schema\/person\/74e4443d1d7ad12d5b4a8db7f63f0194"},"breadcrumb":{"@id":"https:\/\/blexin.com\/en\/blog-en\/google-analytics\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blexin.com\/en\/blog-en\/google-analytics\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blexin.com\/en\/blog-en\/google-analytics\/#primaryimage","url":"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/image00-1.png?fit=1024%2C608&ssl=1","contentUrl":"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/image00-1.png?fit=1024%2C608&ssl=1","width":1024,"height":608},{"@type":"BreadcrumbList","@id":"https:\/\/blexin.com\/en\/blog-en\/google-analytics\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blexin.com\/en\/"},{"@type":"ListItem","position":2,"name":"Google Analytics &lt;3 Angular"}]},{"@type":"WebSite","@id":"https:\/\/blexin.com\/en\/#website","url":"https:\/\/blexin.com\/en\/","name":"Blexin","description":"Con noi \u00e8 semplice","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blexin.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blexin.com\/en\/#\/schema\/person\/74e4443d1d7ad12d5b4a8db7f63f0194","name":"Enrico Bencivenga","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4ea7187309674789d6f02c6b757e1f21c8cf800abb2419b4edaa8b09d4c99548?s=96&d=identicon&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4ea7187309674789d6f02c6b757e1f21c8cf800abb2419b4edaa8b09d4c99548?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4ea7187309674789d6f02c6b757e1f21c8cf800abb2419b4edaa8b09d4c99548?s=96&d=identicon&r=g","caption":"Enrico Bencivenga"},"url":"https:\/\/blexin.com\/en\/author\/enrico-bencivengablexin-com\/"}]}},"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/pcyUBx-6NJ","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/image00-1.png?fit=1024%2C608&ssl=1","_links":{"self":[{"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/posts\/26147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/users\/196716247"}],"replies":[{"embeddable":true,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/comments?post=26147"}],"version-history":[{"count":10,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/posts\/26147\/revisions"}],"predecessor-version":[{"id":31812,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/posts\/26147\/revisions\/31812"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/media\/26078"}],"wp:attachment":[{"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/media?parent=26147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/categories?post=26147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/tags?post=26147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}