I\'m trying to integrate Google Tag Manager with my Ember app. I\'m having a hard time understanding how to notify GTM that the page changed, and send a page view event.
This was asked quite a while ago. With the current feature set of GTM, you can easily set up SPA page tracking without much trouble.
First, go to Triggers
and create a new trigger. Select History Change
as the trigger type. This will create a trigger that fires every time the location history changes.
Then create a new Tag
of Universal Analytics
type and set it up as per the screenshot below.
[
As for the trigger, set the previously defined History Change trigger, and you're done. Every time a navigation occurs in your SPA, a page view event with the proper page path will be triggered.
EDIT: as trognaders
pointed out in a comment, this does not track the initial page view. To remedy, simply add an additional trigger for your tag that fires on the Page View event (All Pages). See screenshot below.