Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

garails

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

garails

  • 1.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

== Google Analytics for Rails

Complete package to use google analytics in your rails application. It supports recording to google analytics:

  • for normal web browsers (javascript)
  • for mobile handsets (gif)
  • programmatically (events)

== Installation

Add to your Gemfile:

gem 'garails'

and run 'bundle install'.

Then create a config/initializers/garails.rb with the following content:

Garails.ga_account = 'UA-12345678-9'

== Usage

=== for normal web browsers

Add to your layout (usually app/views/layouts/application.html.erb) in the head section:

My App ... <%= google_analytics_tracking_javascript %> ...

=== for mobile handsets (non-Javascript)

In your layout for mobile handsets without Javascript support, add at the very bottom of the body the following:

<%= utm_tag %>

=== programmatically

In your view or controller you can record events by using:

ga_event(category, action, label, value)

See http://code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html for details. label and value are optional.

FAQs

Package last updated on 13 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc