From 5c74a6517cbc5aa4aa958abd0737da8892f58a45 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sat, 10 Mar 2012 12:16:20 +0000 Subject: [PATCH] Load the piwik tracking code asynchronously --- app/views/layouts/_piwik.html.erb | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/app/views/layouts/_piwik.html.erb b/app/views/layouts/_piwik.html.erb index 0b719932d..0ba307437 100644 --- a/app/views/layouts/_piwik.html.erb +++ b/app/views/layouts/_piwik.html.erb @@ -1,15 +1,14 @@ - - +var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.defer=true; g.async=true; g.src=u+'piwik.js'; +s.parentNode.insertBefore(g,s); })(); + + -- 2.39.5