Skip to content

Latest commit

 

History

History
141 lines (88 loc) · 2.52 KB

tutorial.md

File metadata and controls

141 lines (88 loc) · 2.52 KB
separator verticalSeparator
<!--s-->
<!--v-->

Tutorial

  • Google Tag Manager
  • Google Analytics
  • USERDIVE

Google Tag Manager

基本的な使い方を覚えましょう。

  • タグ
  • トリガー
  • プレビューモード
  • 変数
  • ワークスペース

Html Script Tag (タグ)

タグマネージャーで反映できる形(カスタムタグ) 中身は JavaScript というものを書きます。

<script>
console.log('hello world')
</script>

image

サイトを作って反映に挑戦する (quickstart)

  1. GTM コンテナを作成する(ID を発効する)
  2. サイトを立ち上げる(Github を使う)
  3. GTM の ID 書き換えて保存する

普段はやらないのでゆっくりやりましょう!

GTM コンテナを作成する (公式)

サイトを立ち上げる (fork する)

fork

サイトを立ち上げる(公開する)

publish

GTM の ID を書き換えて保存する

edit id

Google Analytics を反映する

ga

トリガーを登録する

trigger

作業を開始する

workspace を作る

workspace

USERDIVE にドメイン登録

domain

USERDIVE を反映する (公式)

<!-- USERDIVE tag -->
<script>
(function(e,t,n,c,r,a,s,u){e.USERDIVEObject=r;e[r]=e[r]||function(){(e[r].queue=e[r].queue||[]).push(arguments)};
s=t.createElement(n);u=t.getElementsByTagName(n)[0];s.async=1;s.src=c;s.charset=a;u.parentNode.insertBefore(s,u)
})(window,document,"script","//harpoon3.userdive.com/static/UDTracker.js","ud","UTF-8");
ud("create", "28-105", {"env": "stg"});
ud("analyze");
</script>
<!-- End USERDIVE tag -->

トリガーを作る(限定)

newbie-training/?userdive=1

tregger create

動作確認をする

プレビューモードを使いましょう

preview

クリックした時に

<script>
if (jQuery) {
  jQuery('#about').on('click', function (e) {
    ud('setCustomVar', ['about click'])
  })
}
</script>