To track the anchor link clicks as pageviews in universal analytics i used the following code on my single page website.
var hashtag = /#\S+/
jQuery('.navbar li a').click(function(){
var match = jQuery(this).attr('href').match(hashtag);
ga('send', 'pageview', '/' + match[0]);
})
/*
Now i changed to googel tag manager. Universal analytics is still working but the anchor links are not tracked.
Does anyone have an idea what the problem might be or how i can track the anchor link pageviews with google tag manager?