Hedra
Hedra

Reputation: 89

What is the equivalent of this line of code for Universal Analytics?

I'm searching the equivalent of this line of code from the old Google Analytics for Universal Analytics :

_gaq.push(['_trackPageview', location.pathname + location.search + location.hash]);

Thanks.

Upvotes: 0

Views: 69

Answers (1)

AndiPower
AndiPower

Reputation: 853

ga('send', 'pageview', location.pathname + location.search + location.hash);

should do it

See here

Upvotes: 2

Related Questions