バージョン1 から バージョン2 への更新手順¶
機能追加に伴う導入スニペットの更新頻度を下げるため、トラッキング用のインターフェイスを改良したバージョン2をリリースしました。 バージョン1からバージョン2へは次の手順で更新してください。
バージョン1はバージョン2のリリース後から数ヶ月後にサポート対象外になり、ご利用いただけなくなります。 サポート対象外となりますとReproの機能がご利用いただけなくなりますので、 お早めにバージョン2へアップデートしていただき、ご利用くださいますようお願いします。
導入スニペットの変更¶
スニペットを次のように変更してください。
変更前
<script>
!function(e,r,t){var o={c:null,d:null,e:[],f:[],g:[],h:[],i:[],setup:function(e,r){this.c=[e,r]},setUserID:function(e){this.d=e},track:function(e,r){this.e.push([e,r])},setStringUserProfile:function(e,r){this.f.push([e,r])},setIntUserProfile:function(e,r){this.g.push([e,r])},setDoubleUserProfile:function(e,r){this.h.push([e,r])},setDateUserProfile:function(e,r){this.i.push([e,r])}};window.reproio=window.reproio||o;var i=e.createElement(r),n=e.getElementsByTagName(r)[0];i.src="https://cdn.reproio.com/web/v1/repro-sdk.min.js",i.async=!0,i.onload=function(){if(o.d&&reproio.setUserID(o.d),o.c&&reproio.setup(o.c[0],o.c[1]),o.e.length>0)for(var e=0;e<o.e.length;e++)reproio.track(o.e[e][0],o.e[e][1]);if(o.f.length>0)for(e=0;e<o.f.length;e++)reproio.setStringUserProfile(o.f[e][0],o.f[e][1]);if(o.g.length>0)for(e=0;e<o.g.length;e++)reproio.setIntUserProfile(o.g[e][0],o.g[e][1]);if(o.h.length>0)for(e=0;e<o.h.length;e++)reproio.setDoubleUserProfile(o.h[e][0],o.h[e][1]);if(o.i.length>0)for(e=0;e<o.i.length;e++)reproio.setDateUserProfile(o.i[e][0],o.i[e][1])},n.parentNode.insertBefore(i,n)}(document,"script");
reproio.setup("YOUR_REPRO_SDK_TOKEN")
</script>
変更後
<script>
!function(o,e,n){var r=[];if(window.reproio)console.info("Repro Web SDK was loaded more than once");else{window.reproio=function(){r.push(arguments)};var i=o.createElement(e),t=o.getElementsByTagName(e)[0];i.src="https://cdn.reproio.com/web/v2/repro-sdk.min.js",i.async=!0,i.crossOrigin="",i.onload=function(){window.reproio("setSnippetVersion","2.1"),r.forEach(function(o){window.reproio.apply(window.reproio,o)})},t.parentNode.insertBefore(i,t)}}(document,"script");
reproio("setup", "YOUR_REPRO_SDK_TOKEN");
</script>
ユーザーIDの変更¶
スニペットを次のように変更してください。
変更前
reproio.setUserID("xxxxxxxxxxxx");
変更後
reproio("setUserID", "xxxxxxxxxxxx");
イベントの設定¶
スニペットを次のように変更してください。
変更前
// Custom event
reproio.track("Finished tutorial");
// Custom event with properties
reproio.track("user review", { rating: 3 });
変更後
// Custom event
reproio("track", "Finished tutorial");
// Custom event with properties
reproio("track", "user review", { rating: 3 });
ユーザープロフィールの設定¶
スニペットを次のように変更してください。
String型の場合
変更前
reproio.setStringUserProfile("Job", "Developer");
変更後
reproio("setStringUserProfile", "Job", "Developer");
注釈
- 他の型(例えば int型)の場合については ユーザープロフィール をご参照ください。