Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove template based analytics exclusion #137

Merged
merged 1 commit into from Dec 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,8 @@
# Development

* Remove `exclude_analytics` content block from template
* Add `disable_google_analytics` to config

# 4.4.2

* Modularize the table-filter markup
Expand Down
1 change: 0 additions & 1 deletion README.md
Expand Up @@ -143,7 +143,6 @@ The gem [uses nested layouts](http://guides.rubyonrails.org/layouts_and_renderin
`:body_start` (optional) | Just after the `<body>` tag
`:body_end` (optional) | Just before the `</body>` tag
`:full_width` (optional, boolean) | Expand content to edges of screen.
`:exclude_analytics` (optional, boolean) | Don’t use the default Google Analytics snippet and profile.
`:navbar` (optional) | Custom navbar content, overrides default navbar

Example navbar_items:
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/govuk_admin_template.html.erb
Expand Up @@ -111,7 +111,7 @@
</footer>
</section>
<%= yield :body_end %>
<% unless content_for?(:exclude_analytics) || disable_google_analytics %>
<% unless disable_google_analytics %>
<% if Rails.env.production? %>
<script class="analytics">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
Expand Down
4 changes: 0 additions & 4 deletions spec/dummy/app/views/welcome/exclude_analytics.html.erb

This file was deleted.

1 change: 0 additions & 1 deletion spec/dummy/config/routes.rb
Expand Up @@ -2,7 +2,6 @@
mount GovukAdminTemplate::Engine, at: "/style-guide"
root :to => 'welcome#index'
get '/full-width' => 'welcome#full_width'
get '/exclude-analytics' => 'welcome#exclude_analytics'
get '/custom-pageview-url' => 'welcome#custom_pageview_url'
get '/navbar' => 'welcome#navbar'
get '/with-flashes' => 'welcome#with_flashes'
Expand Down
5 changes: 0 additions & 5 deletions spec/layout/layout_spec.rb
Expand Up @@ -106,11 +106,6 @@
expect(page.body).to include("'root.gov.uk'")
end

it 'can exclude analytics' do
visit '/exclude-analytics'
expect(page).to have_no_selector('script.analytics', visible: false)
end

it 'can specify a custom pageview URL' do
visit '/custom-pageview-url'
expect(page.html).to include("GOVUKAdmin.trackPageview('/not-the-actual-url-the-user-navigated-to');")
Expand Down