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.
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 ?
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
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
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.
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!
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.
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.
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 :)
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
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!
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.
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 :)
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!
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?
Thanks for this video Julian!
Great video as always 😊
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.
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 ?
this helped me a lot, thanks!
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
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
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.
Thanks Julian!!!!
Hey, nice and detailed video. What if we want to trigger a tag on some routes. how can we do that?
build a custom trigger of your data that is available in the dataLayer
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!
probably your web developer has not used the History API correctly. Maybe talk to him to correct
@@MeasureSchool thank you Julian, will check in with him!
the same problem, but in my case I have only 'pushState' value) Will it interfere with the normal collection of statistics?
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?
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.
Hey!
www.simoahava.com/analytics/delay-the-history-change-trigger/
Use that.
Sir I am from India and me , my friends & family want to your video in Hindi.. please.pleease.....please.....please help🙏🙏🙏
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.
Great Video. One question, how can you do the same using GA4?
Great video, always learning new tricks. It would be great if you show us how to deal with /# or query strings. Thanks!!
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 :)
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
in my case I have only 'pushState' value... Will it interfere with the normal collection of statistics?
Hi, you have with Linkedin tracking conversion and SAP with GTM?
Hi, great video. How do to track SPA if the URL doesn't change? Would you use the data layer and use pagePaths? Thanks.
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!
I am waiting for Hindi converted video's about one and half year.. please thing about
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.
Hi Julian, absolute lifesaver with this video. Cheers!
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 :)
I rarely get into specific frameworks. The principles remain the same. Get the dataLayer setup and you should be good on the GTM side
this was awesoem. helpful for sure!
Can you help or release a video on how to integrate Google ads with Salesforce
Hi Julian, thank you so much for this video, I have been stuck for a week and this has unblocked me!
Hi Bro, nice working your concept
Hi Julian, How we can track youtube video events in Single Page Applications SPA??
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??
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!
Can’t you persist campaign source information by using cookie solutions?
Hi Adam, did you ever get this sorted? Having a very similar issue.
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?
Oh wait, nevermind! It seems to be working now! lol thanks, either way! Very helpful video! :)
great videos
Hi! Great, thanks! But how about scrolling for SPA ?
yea, you can't do this with the built in method. You would need to use a custom scroll tracking listener
@@MeasureSchool
did you have some article or video about scrolling for SPA?
all your explanations are excellent and very clear ) Thanks Julian!
Love it! thank you!
I'm glad you found this useful.