How to add <script> in <header>

I like to add the following entry:

in section. How do I do it?

Thanks!

Jim

On 29 December 2015 at 11:07, 天河石 - 谢金鹏 [email protected] wrote:

I like to add the following entry:

in section. How do I do it?

Okay, I will do it for you:

If you later need to remove it, it is quite simple:

Hello!

On Tue, Dec 29, 2015 at 05:07:37PM +0800, 天河石 - 谢金鹏 wrote:

I like to add the following entry:

<script type="text/javascript" async="async"

src=“http://www.google-analytics.com/ga.js”>

in section. How do I do it?

Assuming you want to do it using nginx, try something like this:

sub_filter '</head>'
           '<script type="text/javascript" async="async" 

src=“http://www.google-analytics.com/ga.js”>’;

See docs here for details:

http://nginx.org/en/docs/http/ngx_http_sub_module.html


Maxim D.
http://nginx.org/

On Tuesday, 29 December 2015, Maxim D. [email protected] wrote:

http://nginx.org/en/docs/http/ngx_http_sub_module.html

Here is another way to do it:
https://developers.google.com/speed/pagespeed/module/filter-insert-ga

It relies on even bigger 3rd party module that is also not included and
compiler by default.