How to Track Single Page Applications SPA with the GTM History Trigger

Поділитися
Вставка
  • Опубліковано 16 лис 2024

КОМЕНТАРІ • 50

  • @cowewow
    @cowewow 3 роки тому

    Thank you for this video! Helped me realize that I had my tag set to only trigger once per page, which was blocking the history changes from triggering the tag.

  • @anhlam8663
    @anhlam8663 3 роки тому

    Wow man. Thank you Julian! I've been searching for this for a long time. I was wondering what was wrong with my website because none of the URL changed :(
    .
    .
    And now I know. Thank you so much!

  • @tomskurian
    @tomskurian Рік тому

    Hi
    Could you please help me on this?
    I have the main domin which is wordpress and 2 subdomains, which are single page reactjs applications.
    Will a single tag manager or analytics code is enough or should I add each as a separate property ?

  • @connorstansfield6461
    @connorstansfield6461 3 роки тому

    Hi Julian, absolute lifesaver with this video. Cheers!

  • @mauriciotrindade7438
    @mauriciotrindade7438 3 роки тому

    Thanks for this video Julian!

  • @a2bergman
    @a2bergman 3 роки тому +1

    Great Video. One question, how can you do the same using GA4?

  • @SebastienPujade
    @SebastienPujade 4 роки тому +7

    Hi Julian, many thanks for the video. I will be interested also with your custom settings in case of # or query string examples please? Thanks in advance Sébastien

    • @ameurj
      @ameurj 3 роки тому

      for the query string use an url variable then choose query in the dropdown menu then type in the name of the query so that gtm returns the value (for example type name for ?name=xxxx)
      For # nav links use the link click trigger
      hope this will help

  • @shin0805916
    @shin0805916 2 роки тому

    this was awesoem. helpful for sure!

  • @shyamthakur878
    @shyamthakur878 3 роки тому

    Great video as always 😊

  • @TheKAPILTIWARI
    @TheKAPILTIWARI 2 роки тому +1

    Thanks for this video. Can you please tell us how to track events in a single-page application using click text/class or Id? Because I am not able to see these values in GTM debug mode.

  • @IGOR-ox6jn
    @IGOR-ox6jn 3 роки тому

    Exciting. I tried this but didn't get any tabs in preview with "history" and the variables were all "undefined" when I visited a container loaded / DOM ready. Any reasons why? I followed your steps.

  • @diogomoura101
    @diogomoura101 2 роки тому

    this helped me a lot, thanks!

  • @SurreshRaju
    @SurreshRaju 3 роки тому

    Hi, great video. How do to track SPA if the URL doesn't change? Would you use the data layer and use pagePaths? Thanks.

  • @recursosparaemprendedores88
    @recursosparaemprendedores88 3 роки тому

    Hi, you have with Linkedin tracking conversion and SAP with GTM?

  • @mateorubiogribble6878
    @mateorubiogribble6878 4 роки тому +1

    Great video, always learning new tricks. It would be great if you show us how to deal with /# or query strings. Thanks!!

  • @armenadamyan5890
    @armenadamyan5890 3 роки тому

    in my case I have only 'pushState' value... Will it interfere with the normal collection of statistics?

  • @sandeepparihar7011
    @sandeepparihar7011 4 роки тому +2

    Thanks for this video Julian, but my question is how to track event or goal in google analytics with google tag manager on SPA like angular. Please make a video on this or share guide to me pls.

  • @diegognoatto590
    @diegognoatto590 3 роки тому

    where do i insert the GTm js file? i use barba js , they use the after hook, barba.hooks.after(() => {
    ga('set', 'page', window.location.pathname);
    ga('send', 'pageview');
    }); but dont say where to load the js file , any insight would be welcome :)

  • @sergiomedina5520
    @sergiomedina5520 3 роки тому

    Thank you very much! I understood a lot about how to use Google Tag Manager with React. If it is possible, could you please make a video with an example of GTM and React? especially with events and a little of track routes. There is no a complete video about React and GTM. Thank you again :)

    • @MeasureSchool
      @MeasureSchool  3 роки тому

      I rarely get into specific frameworks. The principles remain the same. Get the dataLayer setup and you should be good on the GTM side

  • @AliMuhammad-he2xe
    @AliMuhammad-he2xe 3 роки тому

    Hey, nice and detailed video. What if we want to trigger a tag on some routes. how can we do that?

    • @MeasureSchool
      @MeasureSchool  3 роки тому

      build a custom trigger of your data that is available in the dataLayer

  • @tudordaniel7918
    @tudordaniel7918 4 роки тому

    Same problem.. first page loads cpc and the second history one is organic.. so, how can we keep the original source of the session in this case?

  • @alexvenceslau800
    @alexvenceslau800 3 роки тому

    Hi Julian, I thing that's solution isn't 100%. I'm having a problem with Real Time content: The title page got by GTA it's always old page's title. It's impossible set/get the title of the future page. My SPA was builded with NEXT.js

  • @katharinawaldl6745
    @katharinawaldl6745 4 роки тому +1

    Hi Julian, many thanks for your video, again! :) And I would also have a question. In my case, the value for the variable "History Source" doesn't seem to follow the same logic as in your example. 2 things are different: (1) The first event fired has the value 'replaceState' and not 'pushState'. And (2) sometimes the only 1 event fires which shows the value 'replaceState', no second event with the 'replaceState'. Is this normal, do I miss something here? Thanks in advance!

    • @MeasureSchool
      @MeasureSchool  4 роки тому +1

      probably your web developer has not used the History API correctly. Maybe talk to him to correct

    • @katharinawaldl6745
      @katharinawaldl6745 4 роки тому

      @@MeasureSchool thank you Julian, will check in with him!

    • @armenadamyan5890
      @armenadamyan5890 3 роки тому

      the same problem, but in my case I have only 'pushState' value) Will it interfere with the normal collection of statistics?

  • @hannadyhal3637
    @hannadyhal3637 4 роки тому

    Hi! Great, thanks! But how about scrolling for SPA ?

    • @MeasureSchool
      @MeasureSchool  4 роки тому

      yea, you can't do this with the built in method. You would need to use a custom scroll tracking listener

    • @hannadyhal3637
      @hannadyhal3637 4 роки тому

      @@MeasureSchool
      did you have some article or video about scrolling for SPA?
      all your explanations are excellent and very clear ) Thanks Julian!

  • @rdsathish9340
    @rdsathish9340 4 роки тому

    Hi Bro, nice working your concept

  • @_iam_amit
    @_iam_amit 4 роки тому

    Hi Julian, many many thanks for this video.
    Can you please explain one thing, that how I can use this history trigger to fire a tag after 5 sec or any time.? (What I mean is that I want to use History event to fire a tag after every 5 sec by GTM Timer Function) Thank you so much.
    Kindly please help me out. - Waiting for your response.

    • @N.a.syed.
      @N.a.syed. 4 роки тому

      Hey!
      www.simoahava.com/analytics/delay-the-history-change-trigger/
      Use that.

  • @alexdelargerebel
    @alexdelargerebel 4 роки тому

    Love it! thank you!

  • @_iam_amit
    @_iam_amit 4 роки тому

    Hi Julian, How we can track youtube video events in Single Page Applications SPA??

    • @scorpi1756
      @scorpi1756 4 роки тому

      I need this info as well as the standard GTM video tracking method does not work. Seems Julian does not reply much to his comments unfortunately??

  • @hadassahpegadodalisay
    @hadassahpegadodalisay 4 роки тому

    Hi Julian! Thank you so much for the great video! I actually followed your steps on my client's SPA site and I'm able to see their core pages being fired on Google Analytic's Realtime report. However, I noticed that when I actually navigate to my client's individual blog and article posts they are not showing up on the Realtime report in GA even though the trigger seems to be firing properly on Tag Manager's Preview Mode. Do you know why this is happening?

    • @hadassahpegadodalisay
      @hadassahpegadodalisay 4 роки тому +1

      Oh wait, nevermind! It seems to be working now! lol thanks, either way! Very helpful video! :)

  • @bryanroper2340
    @bryanroper2340 4 роки тому

    Hi Julian, thank you so much for this video, I have been stuck for a week and this has unblocked me!

  • @firoztak2393
    @firoztak2393 4 роки тому

    Can you help or release a video on how to integrate Google ads with Salesforce

  • @masterji8291
    @masterji8291 4 роки тому +1

    I am waiting for Hindi converted video's about one and half year.. please thing about

  • @mydiarelevant746
    @mydiarelevant746 4 роки тому

    great videos

  • @masterji8291
    @masterji8291 4 роки тому

    Sir I am from India and me , my friends & family want to your video in Hindi.. please.pleease.....please.....please help🙏🙏🙏