Last active
March 22, 2017 08:49
-
-
Save 1987yama3/083d492b75652b7bcc78f7a903dfaa72 to your computer and use it in GitHub Desktop.
E-Commerce DataLayer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
var dataLayer = dataLayer || []; | |
dataLayer.push({ | |
'site_type':'d', | |
'page_type' : 'TOPページ', | |
'customer': { | |
'id': 'C12345', | |
'hashed_email': '1234abcd' | |
}, | |
'product': { // 商品詳細ページでなければこのプロパティは空 | |
'id': 12345, | |
'price': 5400, | |
'category': 'AAA' | |
}, | |
'transaction': { // transactionページでなければこのプロパティは空 | |
'id': 'T12345', | |
'total': 9800, | |
'items': [ | |
{'id':'#商品ID1#','price':'#単価1#','qty':'#数量1#'}, | |
{'id':'#商品ID2#','price':'#単価2#','qty':'#数量2#'}, | |
{'id':'#商品ID3#','price':'#単価3#','qty':'#数量3#'} | |
] | |
} | |
}); | |
</script> |
Googleアナリティクス・トランザクション(拡張eコマース)
カスタムJavaScript変数「GAトランザクション」
function () {
return {
'ecommerce': {
'purchase': {
'actionField': {
'id': {{transaction.id}},
'revenue': {{transaction.total}}
},
'products': {{transaction.items}}
}
}
};
}
GAタグのeコマースイベント
- 拡張eコマース機能を有効にする
- 変数のデータを読む
- GAトランザクション
- トリガー
- ページビューかつpage_type==トランザクション
Adwords CV Tag
コンバージョンタグのカスタムパラメーター
key | value |
---|---|
google_conversion_order_id | {{transaction.id}} |
google_conversion_value | {{transaction.total}} |
YDNコンバージョンタグ
<script type="text/javascript" language="javascript">
/* <![CDATA[ */
var yahoo_ydn_conv_io = "~~~";
var yahoo_ydn_conv_label = "~~~";
var yahoo_ydn_conv_transaction_id = {{transaction.id}};
var yahoo_ydn_conv_amount = {{transaction.total}};
/* ]]> */
</script>
<script type="text/javascript" language="javascript" charset="UTF-8" src="//b90.yahoo.co.jp/conv.js"></script>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GDN動的リマーケティング
ルックアップ変数「GoogleDynamicRemaketingPageType」
リマーケティングタグのカスタムパラメーター