All Projects → danielbayerlein → Middleman Google Analytics

danielbayerlein / Middleman Google Analytics

Licence: mit
📈 A @middleman plugin to handle generating your Google Analytics tracking code.

Projects that are alternatives of or similar to Middleman Google Analytics

Middleman Blog
Middleman : Blog Engine Extension
Stars: ✭ 317 (+248.35%)
Mutual labels:  middleman, gherkin
Newspaper
An aggregated newspaper app containing news from 10+ local news publishers in Hong Kong. Made with ❤
Stars: ✭ 82 (-9.89%)
Mutual labels:  google-analytics
Middleman Thumbnailer
Thumbnailer for middleman
Stars: ✭ 52 (-42.86%)
Mutual labels:  middleman
Poet
Lets you split your ssh_config into separate files
Stars: ✭ 72 (-20.88%)
Mutual labels:  gherkin
Middleman Search
LunrJS-based search for Middleman
Stars: ✭ 57 (-37.36%)
Mutual labels:  middleman
Meteor Iron Router Ga
Google analytics for Iron Router
Stars: ✭ 76 (-16.48%)
Mutual labels:  google-analytics
Plugin Ga
Google Analytics tracking for your book
Stars: ✭ 44 (-51.65%)
Mutual labels:  google-analytics
Godog
Cucumber for golang
Stars: ✭ 1,287 (+1314.29%)
Mutual labels:  gherkin
Middleman Template
The base Middleman application used at thoughtbot, ready to deploy to Netlify.
Stars: ✭ 80 (-12.09%)
Mutual labels:  middleman
React Router Ga
Google Analytics component for React Router
Stars: ✭ 66 (-27.47%)
Mutual labels:  google-analytics
Googleanalyticsforxamarinforms
Google Analytics Plugin for Xamarin Forms
Stars: ✭ 65 (-28.57%)
Mutual labels:  google-analytics
Jekyll ghost importer
Post importer from Ghost backup files.
Stars: ✭ 57 (-37.36%)
Mutual labels:  gherkin
Ganalytics
Interact with Google Analytics using R
Stars: ✭ 77 (-15.38%)
Mutual labels:  google-analytics
Google Measurement Php Client
PHP Client to send analytics data over the Google Measurement Protocol to Google Analytics
Stars: ✭ 52 (-42.86%)
Mutual labels:  google-analytics
Doctor Command
Diagnose problems within WordPress by running a series of checks for symptoms
Stars: ✭ 82 (-9.89%)
Mutual labels:  gherkin
Gwen Web
A web automation engine for Gwen.
Stars: ✭ 47 (-48.35%)
Mutual labels:  gherkin
Middleman Sprockets
Sprockets support for Middleman
Stars: ✭ 62 (-31.87%)
Mutual labels:  gherkin
As3 Universal Analytics
Google Universal Analytics for AS3
Stars: ✭ 73 (-19.78%)
Mutual labels:  google-analytics
Google Analytics Plugin
Cordova Google Analytics Plugin for Android & iOS
Stars: ✭ 90 (-1.1%)
Mutual labels:  google-analytics
Patton
The clever vulnerability dependency finder
Stars: ✭ 87 (-4.4%)
Mutual labels:  gherkin

middleman-google-analytics

Gem Version Build Status Dependency Status Coverage Status

middleman-google-analytics is a Middleman extension that generates Google Analytics tracking code, and keeps your config in config.rb, where it belongs.

Installation

  1. Specify the dependency in your project's Gemfile:
gem 'middleman-google-analytics', '~> 3.0'
  1. Activate the Google Analytics extension in your project's config.rb:
# config.rb
activate :google_analytics do |ga|
  ga.tracking_id = 'UA-XXXXXXX-X' # Replace with your property ID.
end
  1. In your layout, after your footer, call google_analytics_tag and include the results in the page:

Haml:

= google_analytics_tag

ERB:

<%= google_analytics_tag %>

JavaScript with ERB (js.erb):

<%= google_analytics_tag %>

Configuration

activate :google_analytics do |ga|
  # Property ID (default = nil)
  ga.tracking_id = 'UA-XXXXXXX-X'

  # Removing the last octet of the IP address (default = false)
  ga.anonymize_ip = false

  # Tracking across a domain and its subdomains (default = nil)
  ga.domain_name = 'example.com'

  # Tracking across multiple domains and subdomains (default = false)
  ga.allow_linker = false

  # Enhanced Link Attribution (default = false)
  ga.enhanced_link_attribution = false

  # Container ID for Google Optimize (A/B Testing)
  ga.optimize = 'GTM-123456'

  # Log detail messages to the console (default = false)
  ga.debug = false

  # Trace debugging will output more verbose information to the console (default = false)
  ga.debug_trace = false

  # Disable extension (default = false)
  ga.disable = true

  # Testing your implementation without sending hits (default = true) in development
  ga.test = true

  # Compress the JavaScript code (default = false)
  ga.minify = false

  # Output style - :html includes <script> tag (default = :html)
  ga.output = :js

end

Usage

Once you've bundled you should be able to run middleman as normal, and have it display the GA tracking code.

Special Thanks

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

Copyright (c) 2014-present Daniel Bayerlein. See LICENSE for details.

Copyright (c) 2013 Jon Frisby.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].