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

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

КОМЕНТАРІ • 54

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

    Thanks for this video Julian!

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

    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.

  • @tomskurian
    @tomskurian 11 місяців тому

    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 ?

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

    this helped me a lot, thanks!

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Hi Julian, absolute lifesaver with this video. Cheers!

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

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

    this was awesoem. helpful for sure!

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

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

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

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

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

    Hi Bro, nice working your concept

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

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

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

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

    great videos

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

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

    Love it! thank you!