Google Analytics from a file:// url

后端 未结 6 2023
南方客
南方客 2020-12-06 01:23

We have an ajaxy sort of html based app framework thing and want google analytics to work with it. And I believe we have set things up properly to manually call _trac

6条回答
  •  遥遥无期
    2020-12-06 02:08

    Ended up with a complex bounce through an iframe via the resize hack message passing mechanism.

    Local file include an iframe on our server. When we want to track a GA call we changes it's url hash with the info we need #_trackEvent,foo,bar, and then change the width of the iframe. In the iframe the onresize() function gets triggered and allows us to submit GA calls by inspecting the hash.

    As much as I hate this hack, it works flawlessly!

提交回复
热议问题