Is it possible to put Google Analytics code in an external JS file?

后端 未结 8 797
生来不讨喜
生来不讨喜 2021-02-05 02:56
var gaJsHost = ((\"https:\" == document.location.protocol) ? \"https://ssl.\" : \"http://www.\");
document.write(unescape(\"%3Cscript src=\'\" + gaJsHost + \"google-anal         


        
8条回答
  •  情话喂你
    2021-02-05 03:33

    This will work if you divide the script into 2 scripts the same way Google Analytics has divided the traditional script into 2 script tags.

提交回复
热议问题