Setup Google Analytics with Google Tag Manager and Angular

Поделиться
HTML-код
  • Опубликовано: 6 сен 2024
  • Learn about setting up and configuring Analytics using the recommended Google Tag Manager (GTM) library in an Angular Application.
    Writeup and tutorial here:
    fluin.io/blog/...

Комментарии • 56

  • @peterschikezie8432
    @peterschikezie8432 4 года назад +2

    thanks for this video. however, you did not complete it. after you finished setting up on your code why didnt confirm if the page view were actually sent to google analytics?

  • @dleasman
    @dleasman Год назад

    What if you are a multi tenant system, and we want to see tracking per tenant of our system. Is there a way to inject our tenantId into the equation so we can see tracking by Tenant?

  • @chamaileon81
    @chamaileon81 2 года назад

    Very nice tutorial, quick, easy and very thorough. Great job!

  • @olwethumbada7815
    @olwethumbada7815 2 года назад

    Thanks, Stephen this is still relevant.

  • @hagbard6880
    @hagbard6880 5 лет назад +1

    Hi. Thanks for the Video. I tried it with an GTM Account (Tracking-ID GTM-XXXXXXX). The Pageview works fine, but i can't get any Events like click or custom Events. Do you have any advices? I tried it with angulartics2

  • @pallavisonawane1681
    @pallavisonawane1681 Год назад

    When we are trying to implement GTM (Google Tag Manager) code in our Angular Universal application, we are facing following challenges:
    The tag changes include some JQuery parameters/fields which are not working in Angular and giving us errors and those errors are running in infinite loop. The error is related to $ not defined. As per the requirements we are not allowed to use JQuery library.
    In the tag changes throwing us error related not supporting items in .
    please help me out

  • @joshsommer3451
    @joshsommer3451 5 лет назад +2

    Is there any benefit to setting GTM to listen to router change events VS using GTM's History change trigger? Currently, this is how we have implemented GTM with our Angular app and I particularly like it since we didn't have to add any extra code or router subscriptions to track our analytics.

    • @Mariojsnunes
      @Mariojsnunes 5 лет назад +1

      Yeah, I would like to know this too. Is there any benefit for this?

    • @DigitalFluency
      @DigitalFluency  5 лет назад +1

      I'm not a GTM expert, but I believe Analytics uses GTM's GTAG JS SDK now in the recommended way to track events, but you don't have to have GTM setup to use it this way. if you are already using GTM and have it setup, the server side creation of a History Change trigger will work just fine, but give you less fine grained control over events.

    • @Mariojsnunes
      @Mariojsnunes 5 лет назад

      @@DigitalFluency Awesome! Thanks!

  • @pebito
    @pebito 5 лет назад +1

    Super useful stuff Steven, thanks for posting this. Exactly what I need to implement at work. Clear explanation! :)

  • @oleersoy6547
    @oleersoy6547 4 года назад

    That's AWESOME!!!!! Quick and too the point!! Nice work!!

  • @themanthis837
    @themanthis837 4 года назад

    How comes this does not work in production, when I build it with ./gradlew? If I run the "npm start" it does work but thats kinda useless since I need this in production.

  • @SplitterAlex1990
    @SplitterAlex1990 5 лет назад +1

    Happy new Year and welcome back! Looking forward to 2019 and your upcoming videos :)

  • @ikezedev
    @ikezedev 5 лет назад

    Thanks Stephen...This channel should have 500k subscribers already 😍

  • @MarkusThiel
    @MarkusThiel 5 лет назад

    Why do you remove it from index.html and have it just trigger on navigationEnd?.. what is the benefit of having it triggered "manually".. if you leave it in index.html you should not need to bother with it right?

  • @malacadanet
    @malacadanet 2 года назад +1

    You made it so easy. Thanks a lot!

  • @SorinBucse
    @SorinBucse 10 месяцев назад

    Great video I can't wait to hook it up on my site

  • @mokraneidris1175
    @mokraneidris1175 Год назад

    thank you so much brother , really amazing and effective explanation

  • @ayushgupta8844
    @ayushgupta8844 4 года назад

    What will happen if I speed browse things ? That is quickly move from about to home, in my case it batched the two requests, but only the last one was seen in the realtime tab. Any idea what could have gone wrong

  • @QuickZ_
    @QuickZ_ 5 лет назад

    wow nice, every navigation sends to googleanalytics now. And thanks for a good explanation.

  • @eivanphils
    @eivanphils 2 года назад

    Hi, men. What happens if you have a hash in the url?

  • @rafaelzasas9421
    @rafaelzasas9421 3 года назад

    Why not store all the project keys in the environment variables?

  • @marcosgalaviz4904
    @marcosgalaviz4904 3 года назад

    Very nice but, how can I add personalized events? example a click somewhere or somethig else? thanks in advance

  • @oleksandrbasov9049
    @oleksandrbasov9049 5 лет назад +1

    Thanks s lot! That worked great. Your solution really made my day!

  • @manojkumarvalapala5157
    @manojkumarvalapala5157 5 лет назад

    Hi sir,
    please try to make make videos on bootstrap basics like register forms , carousels , ecommerce website.....please sir u the best explainer comparing to any other one i have seen in the youtube.....please start bootstrap also as quickly as possible sir......i hope it'll help many students like me..

  • @rogerperlaza1848
    @rogerperlaza1848 5 лет назад

    good day I have problems when I use traffic sources (advertising) since it does not associate the events with the traffic source, if it does not add them to the general gtm, any recommendation

  • @venky76v
    @venky76v 5 лет назад

    Brilliant. How about an example where there are form controls in a page and I want to track what form controls users visited?

  • @GuillermoArellano
    @GuillermoArellano 5 лет назад

    This was awesome! Thanks Stephen.

  • @alexgtr84
    @alexgtr84 5 лет назад

    Awesome!! Thank you very much for this one!

  • @hamzaakbar5321
    @hamzaakbar5321 2 года назад

    Hi this is very informative. but i want to track event with google analytics plz share a video if it have?

  • @XxhoseinxX
    @XxhoseinxX 4 года назад

    short and nice, appreciated :)

  • @almshakeel
    @almshakeel 3 года назад

    omg u save my life ty so much
    but if i want make each page have private analysis can i do that ?

  • @lifeTechnicolorGuy
    @lifeTechnicolorGuy 5 лет назад

    Nice tutorial. how do you send custom events? Like if you want to track a specific function on a component?

  • @electromoderneappliancerep4194
    @electromoderneappliancerep4194 3 года назад

    great and super usefull

  • @DarkNorthForest
    @DarkNorthForest 2 года назад

    Thank you

  • @nerdiloo9863
    @nerdiloo9863 5 лет назад

    Not too shabby SF! 👍

  • @alexey36241
    @alexey36241 5 лет назад

    That's nice, but how would you add the GTM script for multiple environments (prod/staging) with different container ids?

    • @DigitalFluency
      @DigitalFluency  5 лет назад

      I'd use the environments file and store the ID there.

    • @alexey36241
      @alexey36241 5 лет назад

      @@DigitalFluency yes, but the script link contains the ID param. And I think it's not possible to use env variables inside index.html

    • @DigitalFluency
      @DigitalFluency  5 лет назад +1

      I think I misread the question. You can inject the script yourself at runtime. This may break universal builds FYI.
      const script = document.createElement('script');
      script.async = true;
      script.src = 'www.googletagmanager.com/gtag/js?id=' + environment.code;
      document.head.prepend(script);

    • @aravindharigoppula7041
      @aravindharigoppula7041 5 лет назад

      @@DigitalFluency I tried this but it is not working. It is very strange that angular is developed by google and there no direct way of handling google tag manager in angular. This is very common scenario to inject multiple container Ids for different environments. Not able to dynamically inject container id for each environment.

  • @gianfigueroa
    @gianfigueroa 5 лет назад

    ERROR en src / app / app.component.ts (25,7): error TS2304: No se puede encontrar el nombre 'gtag'.plis any solutions

  • @X3noic
    @X3noic 3 года назад

    thx so much, this help me

  • @Synkto01
    @Synkto01 5 лет назад

    Awesome!!...thak you!!

  • @mikaelgross6588
    @mikaelgross6588 5 лет назад +9

    Your typing destroyed my confidence :)

  • @sefayalcindag4065
    @sefayalcindag4065 3 года назад

    Thank you so much :)

  • @Eskimoz
    @Eskimoz 5 лет назад

    Sans aucune hésitation on applaudit !

  • @ewgeniyburlakov6233
    @ewgeniyburlakov6233 5 лет назад

    СПАСИБО
    You very helped me

  • @johnnyam8222
    @johnnyam8222 3 года назад

    do one with facebook pixel and its events please

  • @cguider6719
    @cguider6719 4 года назад

    Thanks