falsandtru / pjax-api

The advanced PJAX superior to SPA.
https://falsandtru.github.io/pjax-api/
Apache License 2.0
318 stars 28 forks source link

QUESTION: How to update google analytcis #25

Closed Buliwyfa closed 7 years ago

Buliwyfa commented 7 years ago

It's not clear to me :( how can I update Google Analytics.

I guessing something like this:

Pjax.load({ if (typeof ga === 'function') { ga('send', 'pageview', location.pathname); } });

However, not sure how to call GA after the new content is loaded via Pjax

Thanks again!!

seanthepottingshed commented 7 years ago

$('.pjax-container').on('pjax:end', function() { ga('send', 'pageview', location.pathname); });

Buliwyfa commented 7 years ago

thx

seanthepottingshed commented 7 years ago

Actually not sure if the above will work as it's for defunkt pjax

falsandtru commented 7 years ago

See #20