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

Поделиться
HTML-код
  • Опубликовано: 12 сен 2024
  • НаукаНаука

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

  • @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!

  • @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

  • @mateorubiogribble6878
    @mateorubiogribble6878 3 года назад +1

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

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

    Hi Julian, absolute lifesaver with this video. Cheers!

  • @a2bergman
    @a2bergman 3 года назад +1

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

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

    Great video as always 😊

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

    Thanks for this video Julian!

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

    this was awesoem. helpful for sure!

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

    this helped me a lot, thanks!

  • @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.

  • @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.

  • @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

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

    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 ?

  • @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.

  • @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.

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

    Love it! thank you!

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

    Hi Bro, nice working your concept

  • @katharinawaldl6745
    @katharinawaldl6745 3 года назад +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  3 года назад +1

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

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

      @@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?

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

    Thanks Julian!!!!

  • @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

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

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

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

    Hey Julian. The History trigger is very handy for keeping track of virtual pageviews indeed. But from a Google Ads perspective, imagine this scenario: A user clicks a Google Ad and is taken to a landing page and the gclid is successfully appended and present upon landing on that page. There is a form to fill out, and then a thankyou message is presented on the page dynamically. In the situation I'm dealing with now, the developers have coded the site to change the URL when that happens from "/mylandingpage?gclid=123456789" to "/mylandingpage/thank-you". This was a request made by the previous media agency so they could attempt to track it. But I don't think they understood the site is a single page application and they were thinking in traditional real page load tactics.. I've currently set the Google Ad Conversion tag to fire upon the history change when it changes the URL to "/mylandingpage/thank-you". The tag successfully fires, but then instead of getting classified as google/cpc within Analytics, it is showing as google/ Organic. So the question is: Would it be better to have the developers not change the URL to "thank-you" (for future landing pages) and instead just keep the URL the same and I can fire off the Google Ads Conversion tag using a Visibility trigger for that confirmation message when it is loaded? That way the gclid isn't lost.. How would you suggest reporting on that, just compare session count of the landing page for that campaign within { Analytics Reports > Acquisition > Google Ads } to { Google Ads Reports > Conversion Action > All Conversions } ? That's where I'm leaning but would love to hear your thoughts. Thank you for all your videos, sir!

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

      Can’t you persist campaign source information by using cookie solutions?

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

      Hi Adam, did you ever get this sorted? Having a very similar issue.

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

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

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

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

  • @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?

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

    great videos

  • @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

  • @_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.

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

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

  • @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 :)

  • @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! :)

  • @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!

  • @masterji8291
    @masterji8291 4 года назад +1

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

  • @_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??

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

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