0
Google 애널리틱스를 포함하기 위해 부분 및 Google 애널리틱스 레일 젬을 모두 사용해 보았지만 아무 결과도 얻지 못했습니다. 내 계정에 로그인 할 때 코드가 실제로 프로덕션 서버로 푸시되기 전에 도메인에서 데이터를 수신하고 있다고 말하기 때문에이 데이터는 매우 드뭅니다.Google 애널리틱스 레일 4로 데이터 전송 안함
첫번째 시도
레이아웃/_google_analytics.html.erb
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'Figs.third_party_keys.google.analytics']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
다음 내가 응용 프로그램에 걸쳐 사용되는 여러 가지 레이아웃에서이 부분이라고합니다. 아래 예. 이것은 어떤 결과를 제공하지
= render '/layouts/google_analytics'
application.html.slim 그래서 그때는 구글-분석 레일 보석으로 전환. 나는 보석을 설치하고 번들을 실행 한 후 내 production.rb에서 나는 다음 줄 추가 :
GA.tracker = "UA-xxxxxx-x" (I tried this with and without Figgy)
은 내가 찾고 결과를 얻는 매우 간단한 작업하지만 이들 모두 같은 느낌을. 그것은 Figgy를 사용하여 시도 할 수 있습니다.