Google Analytics script injection
Problem this snippet solves: Add google analytics script in the html content of the HTTP response. Works also for other Analytics providers like Piwik. How to use this snippet: Installation
File...
Updated Jun 06, 2023
Version 2.0Yann_Desmarest
Cirrus
Joined September 11, 2012
Bryan_McCoy
Oct 29, 2020Nimbostratus
I was able to get this to work for a different .js file insertion but had to make a change to the string map line at the end to remove a set of quotes and include the partition.
HTTP::payload replace 0 $content_length [string map [list $search [subst -nocommands -nobackslashes [ifile get "/Common/newrelic.js"]]</head>] [HTTP::payload]]