在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):bgarret/google-analytics-rails开源软件地址(OpenSource Url):https://github.com/bgarret/google-analytics-rails开源编程语言(OpenSource Language):Ruby 100.0%开源软件介绍(OpenSource Introduction):Fast Universal Google Analytics setup for Rails. This gem is mostly intended for small to medium websites with a simple analytics strategy. For older analytics, please use InstallationAdd the following to your gem 'google-analytics-rails', '1.1.1' Then run:
Upgrade NotesUpgrading this gem from 0.0.6? Use GoogleAnalytics::Events::SetAllowLinker is no longer supported as an external variable being set. You can submit as normal in the GoogleAnalytics::Events::SetCustomVar is no longer supported by Universal Analytics. These have been changed to SetCustomDimension & SetCustomMetric. By default if you use SetCustomVar, it applies as a Dimension GoogleAnalytics::Events::DeleteCustomVar has been removed Added Event Helpers
TODO: Add Double Click Snippet Support While the code is there, and it looks like it is simply changing the end path to the JS, this feature has not been tested. Documentationhttp://rubydoc.info/github/bgarret/google-analytics-rails Example configurationsProduction only
# replace this with your tracker code
GA.tracker = "UA-112233-4"
<%= analytics_init if GoogleAnalytics.valid_tracker? %> With DoubleClick instead of vanilla Google Analytics script
# replace this with your tracker code
GA.tracker = "UA-556677-8"
GA.script_source = :doubleclick
<%= analytics_init if GoogleAnalytics.valid_tracker? %> Different accounts for staging and production
# replace this with your production tracker code
GA.tracker = "UA-990011-2"
# replace this with your staging tracker code
GA.tracker = "UA-334455-66"
<%= analytics_init if GoogleAnalytics.valid_tracker? %> Premium Google Analytics accounts
# add this if you have a premium account and need to use the additional dimension/metric indices
# - premium accounts are allowed to have 200 custom dimensions/metrics
# - regular accounts are allowed 20
# see also: https://support.google.com/analytics/answer/2709828?hl=en#Limits
GA.premium_account = true Licensegoogle-analytics-rails is released under the MIT license: ThanksMany thanks to the people that took time to submit patches. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论