Question about Google Analytics Tracking (w/ Rails)

前端 未结 5 1525
深忆病人
深忆病人 2021-02-10 21:17

I\'ve got google analytics setup on a rails project, and I\'ve got \"A single domain (default)\" selected for the tracking options.

I\'ve copied and pasted the js code i

5条回答
  •  一向
    一向 (楼主)
    2021-02-10 21:58

    I tried the gems but they didn't work; wouldn't spit out any code, etc. Seemed dumb for something so simple. So I ended up just doing this, in application.html.erb:

    <% if Rails.env.production? %>
    (GA JS Code Snippet)
    <% end %>
    

提交回复
热议问题