Google Tag Manager and Vaadin

Hi,
We’ve started using Google Tag Manager (GTM) throughout our website and attempted with some success for our Vaadin app. It works on the most part, however, I’m trying to action when some tags when there is a change of page.
I found this blog http://www.simoahava.com/gtm-tips/track-url-fragments-as-pageviews/
where they use popstate to track the page change.

My experience with Vaadin is limited, is this how Vaadin works?

Has anyone else had experience with GTM and Vaadin? What is the best way to track the page changes?