{"id":13463497,"url":"https://github.com/bgarret/google-analytics-rails","last_synced_at":"2025-03-25T06:32:24.162Z","repository":{"id":54722273,"uuid":"2000357","full_name":"bgarret/google-analytics-rails","owner":"bgarret","description":"Rails 3 helpers to manage google analytics tracking. Mostly intended for small to medium websites.","archived":false,"fork":false,"pushed_at":"2021-02-02T16:14:14.000Z","size":99,"stargazers_count":323,"open_issues_count":6,"forks_count":44,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-10-02T07:40:02.272Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bgarret.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.markdown","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-07-05T12:41:24.000Z","updated_at":"2024-07-31T17:24:43.000Z","dependencies_parsed_at":"2022-08-14T00:50:21.898Z","dependency_job_id":null,"html_url":"https://github.com/bgarret/google-analytics-rails","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgarret%2Fgoogle-analytics-rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgarret%2Fgoogle-analytics-rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgarret%2Fgoogle-analytics-rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgarret%2Fgoogle-analytics-rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bgarret","download_url":"https://codeload.github.com/bgarret/google-analytics-rails/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222045615,"owners_count":16921984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T13:00:54.422Z","updated_at":"2024-10-29T12:31:29.955Z","avatar_url":"https://github.com/bgarret.png","language":"Ruby","funding_links":[],"categories":["Web Apps, Services \u0026 Interaction"],"sub_categories":["Web Analytics"],"readme":"Fast Universal Google Analytics setup for Rails. This gem is mostly intended for small to medium websites with a simple analytics strategy.\n\n[![Build Status](https://travis-ci.org/bgarret/google-analytics-rails.png?branch=master)](https://travis-ci.org/bgarret/google-analytics-rails)\n\nFor older analytics, please use `0.0.6`_\n\nInstallation\n============\n\nAdd the following to your `Gemfile`:\n\n```ruby\ngem 'google-analytics-rails', '1.1.1'\n```\n\nThen run:\n\n    bundle install\n\nUpgrade Notes\n============\n\n__Upgrading this gem from 0.0.6?__\n\nUse `analytics_init` to send submissions to Analytics if you are using multiple trackers. You can supply a name to tracker by passing `:name` option.\n\n**GoogleAnalytics::Events::SetAllowLinker** is no longer supported as an external variable being set. You can submit as normal in the `:add_events` array, but using the new `:setup` config is preferable so no extra array searching has to happen.\n\n**GoogleAnalytics::Events::SetCustomVar** is no longer supported by Universal Analytics. These have been changed to SetCustomDimension \u0026 SetCustomMetric. By default if you use SetCustomVar, it applies as a Dimension\n\n**GoogleAnalytics::Events::DeleteCustomVar** has been removed\n\n**Added Event Helpers**\n\n  - GoogleAnalytics::Events::ExperimentId\n  - GoogleAnalytics::Events::ExperimentVariation\n\n**TODO:** Add Double Click Snippet Support\nWhile the code is there, and it looks like it is simply changing the end path to the JS, this feature has not been tested.\n\n\n\nDocumentation\n=============\n\nhttp://rubydoc.info/github/bgarret/google-analytics-rails\n\nExample configurations\n======================\n\nProduction only\n---------------\n\n`config/environments/production.rb`:\n\n```ruby\n# replace this with your tracker code\nGA.tracker = \"UA-112233-4\"\n```\n\n`app/views/layout/application.html.erb`, in the `\u003chead\u003e` tag :\n\n```erb\n\u003c%= analytics_init if GoogleAnalytics.valid_tracker? %\u003e\n```\n\nWith DoubleClick instead of vanilla Google Analytics script\n-----------------------------------------------------------\n\n`config/environments/production.rb`:\n\n```ruby\n# replace this with your tracker code\nGA.tracker = \"UA-556677-8\"\nGA.script_source = :doubleclick\n```\n\n`app/views/layout/application.html.erb`, in the `\u003chead\u003e` tag :\n\n```erb\n\u003c%= analytics_init if GoogleAnalytics.valid_tracker? %\u003e\n```\n\nDifferent accounts for staging and production\n-------------------------------------------------\n\n`config/environments/production.rb`:\n\n```ruby\n# replace this with your production tracker code\nGA.tracker = \"UA-990011-2\"\n```\n\n`config/environments/staging.rb`:\n\n```ruby\n# replace this with your staging tracker code\nGA.tracker = \"UA-334455-66\"\n```\n\n`app/views/layout/application.html.erb`, in the `\u003chead\u003e` tag :\n\n```erb\n\u003c%= analytics_init if GoogleAnalytics.valid_tracker? %\u003e\n```\n\nPremium Google Analytics accounts\n---------------------------------\n\n`config/environments/production.rb`:\n\n```ruby\n# add this if you have a premium account and need to use the additional dimension/metric indices\n# - premium accounts are allowed to have 200 custom dimensions/metrics\n# - regular accounts are allowed 20\n# see also: https://support.google.com/analytics/answer/2709828?hl=en#Limits\nGA.premium_account = true\n```\n\nLicense\n=======\n\n[google-analytics-rails](https://github.com/bgarret/google-analytics-rails) is released under the MIT license:\n\n* http://www.opensource.org/licenses/MIT\n\nThanks\n======\n\nMany thanks to [the people that took time to submit patches](https://github.com/bgarret/google-analytics-rails/contributors).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgarret%2Fgoogle-analytics-rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbgarret%2Fgoogle-analytics-rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgarret%2Fgoogle-analytics-rails/lists"}