How do I dynamically load Google Analytics JavaScript?

前端 未结 5 2268
[愿得一人]
[愿得一人] 2020-12-02 21:29

Without using any other JS frameworks (dojo, jquery, etc), how would I dynamically load Google Analytic\'s javascript to be used on a web page for w

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-02 22:05

    Server side programming would be easier I guess, but I found this some time ago. Notice that it specifically sets it to the html head.

    Also check on the first link down on 'Adding Javascript Through Ajax'.

提交回复
热议问题