Skip to content

Commit

Permalink
Merge pull request #1 from lloydpick/master
Browse files Browse the repository at this point in the history
Page Load Times
  • Loading branch information
achiurizo committed May 14, 2011
2 parents 485e4e2 + 8a005d9 commit b29ed0a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/rack/templates/async.erb
Expand Up @@ -10,6 +10,7 @@
_gaq.push(['_setAllowLinker', true]);
<% end %>
_gaq.push(['_trackPageview']);
_gaq.push(['_trackPageLoadTime']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
Expand Down
4 changes: 2 additions & 2 deletions test/test_rack-google-analytics.rb
Expand Up @@ -10,7 +10,7 @@ class TestRackGoogleAnalytics < Test::Unit::TestCase
assert_match %r{\_gaq\.push}, last_response.body
assert_match %r{\'\_setAccount\', \"somebody\"}, last_response.body
assert_match %r{</script></head>}, last_response.body
assert_equal "495", last_response.headers['Content-Length']
assert_equal "532", last_response.headers['Content-Length']
end

should "not add tracker to none html content-type" do
Expand All @@ -31,7 +31,7 @@ class TestRackGoogleAnalytics < Test::Unit::TestCase
should "add multiple domain script" do
get "/"
assert_match %r{'_setDomainName', \"mydomain.com\"}, last_response.body
assert_equal "542", last_response.headers['Content-Length']
assert_equal "579", last_response.headers['Content-Length']
end
end

Expand Down

0 comments on commit b29ed0a

Please sign in to comment.