thybag / PJAX-Standalone

A standalone implementation of Pushstate AJAX, for non-jquery webpages.
203 stars 42 forks source link

Add google tag manager to fire with pjax request #4

Closed raunakkathuria closed 10 years ago

raunakkathuria commented 11 years ago

Hi

Can you please provide the mechanism to how to fire google tag manager script on pjax request.

Regards Raunak

thybag commented 10 years ago

Hello,

It depends exactly what you wish to track, but in theory you could just add the code to the complete callback

pjax.connect({
    'container': 'content',
    'complete': function(){
        // Google tag manager code here
    }
});