ディレクターでもコピペで簡単実装出来るGoogle Analyticsのイベントトラッキング 10月 1, 2015 tanamako 読了: 約 3 分 Google Analyticsを使ってサイトやメディアの分析をしている方が多いかと思います。グーグルアナリティクスで、ページのトラッキングだけでなく、ディレクターの要望に応じて『このリンクのイベント数を計測したい』という事があるかと思います。または、エンジニアの力を借りる事なく簡単に計測できるようにしたいという事がある場合に簡単にコピペで取得できる方法をご紹介します。 JS側の設定 // 現在表示されているURLを取得 function getUrl(){ return location.href.replace(/\#.*$/, '').replace(/\?.*$/, ''); } // aタグに付与 $('.js-gaTrack