# アフィリエイトサイトの測定タグについて

**URL:** <https://community.shopify.com/t/topic/75421>\
**Category:** 技術的なQ＆A\
**Created:** [November 1, 2021, 9:31am UTC](https://community.shopify.com/t/topic/75421 "2021-11-01T09:31:14Z")\
**Posts on this page:** 1\
**Page:** 1

## AI-generated summary

アフィリエイト計測タグ（AmebaPick／tracker.js）をShopifyの「チェックアウト＞追加スクリプト」に設置したところ、amount と item の値が不正になる問題。コード断片が提示されており、内容が理解に必須。

amount は「306000」と出力されており「0が2つ多い」と認識。通貨単位のずれを想定し、"306000"/100 にする案を提示して妥当か確認を求めている。

item は「#<Checkout::LineItem:0x...>」のオブジェクト文字列が連結されてしまい、実際の商品情報が取得できていない。元の実装は trk("configure", "item", "{{checkout.line_items}}"); で、Shopifyの The checkout object を参照したが期待値が得られず、代替として trk("configure", "item", "item"); で計測できるかを質問。

参照資料として KARTE サポート記事のURLを提示。現時点で回答・解決はなく、金額の単位調整可否と line_items の適切な展開方法が未確定のまま。

<div class="post-metadata">

**Author:** ![suyeon](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@suyeon](https://community.shopify.com/u/suyeon)\
**Post date:** [November 1, 2021, 9:31am UTC](https://community.shopify.com/t/topic/75421/1 "2021-11-01T09:31:14Z")

</div>

アフィリエイトサイト（アメバピック）の測定タグについて質問があります！

チェックアウト＞追加スクリプトにて追加しましたが、amountとitemのどころがエラーです。。

!function(e,t,n,r,a,c,s){e.TrackerObject=a,e[a]=e[a]||  
function(){(e[a].q=e[a].q||).push(arguments)},  
e[a].l=1\*new Date,c=t.createElement(n),  
s=t.getElementsByTagName(n)[0],c.async=1,c.src=r+“?\_t=”+e[a].l,  
s.parentNode.insertBefore(c,s)}  
(window,document,“script”,“[https://script-ad.mobadme.jp/js/tracker.js](https://script-ad.mobadme.jp/js/tracker.js)”,“trk”);  
trk(“configure”, “type”, “1”);  
trk(“configure”, “conversion\_type”, “1”);  
trk(“configure”, “uid”, “1021”);  
trk(“configure”, “amount”, “306000”); ←0が2つ多い  
trk(“configure”, “item”, “#Checkout::LineItem:0x00007f13362d3a48#Checkout::LineItem:0x00007f13362d39f8”); ←itemがちゃんと返ってきていない  
trk(“configure”, “status”, “1”);  
trk(“configure”, “hash”, “”);  
trk(“send”, “44513”);

※trk(“configure”, “amount”, “306000”);

→trk(“configure”, “amount”, “306000”/100); にすれば解決できそうですが、どうでしょうか。

※trk(“configure”, “item”, “#Checkout::LineItem:0x00007f13362d3a48#Checkout::LineItem:0x00007f13362d39f8”);

→shopifyのThe checkout objectに書いてある通りしましたが、

itemが取れてない状態です。

元（trk(“configure”, “item”, “{{checkout.line\_items}}”);）

もしかしたら

trk(“configure”, “item”, “item”);

の方が測定できますでしょうか。

karte supportというサイトから参考にしました。

（[https://support.karte.io/post/2n0VFdxwe3z9wmsYVVCPcG）](https://support.karte.io/post/2n0VFdxwe3z9wmsYVVCPcG%EF%BC%89)

ご存じの方がいらっしゃいましたら、  
是非よろしくお願い致します。
