This file contains hidden or 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
| // Intimate Merger | |
| !function(a,b,c,d){if(!b[a]){b[a]=function(){b[a].instances.push(this),this.init&&this.init()},b[a].instances=[];for(var e=0,f=["td_send","td_send_imid"];e<f.length;e++)b[a].prototype[f[e]]=function(a){return function(){this["tmp_"+a]=this["tmp_"+a]||[],this["tmp_"+a].push(Array.prototype.slice.call(arguments))}}(f[e]);var g=c.getElementsByTagName(d)[0],h=c.createElement(d);h.async=!0,h.src="//cf.im-apps.net/sdk/tdim-1.1.0.min.js",g.parentNode.insertBefore(h,g)}}("TDIM",window,document,"script"); | |
| !function(t,e){if(void 0===e[t]){e[t]=function(){e[t].clients.push(this),this._init=[Array.prototype.slice.call(arguments)]},e[t].clients=[];for(var r=function(t){return function(){return this["_"+t]=this["_"+t]||[],this["_"+t].push(Array.prototype.slice.call(arguments)),this}},n=["addRecord","set","trackEvent","trackPageview","ready"],s=0;s<n.length;s++){var i=n[s];e[t].prototype[i]=r(i)}var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=("https:"===document.locatio |
This file contains hidden or 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
| (function() { | |
| // td tag | |
| !function(t,e){if(void 0===e[t]){e[t]=function(){e[t].clients.push(this),this._init=[Array.prototype.slice.call(arguments)]},e[t].clients=[];for(var r=function(t){return function(){return this["_"+t]=this["_"+t]||[],this["_"+t].push(Array.prototype.slice.call(arguments)),this}},s=["addRecord","set","trackEvent","trackPageview","trackClicks","ready"],a=0;a<s.length;a++){var c=s[a];e[t].prototype[c]=r(c)}var n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src=("https:"===document.location.protocol?"https:":"http:")+"//cdn.treasuredata.com/sdk/1.6.0/td.min.js";var i=document.getElementsByTagName("script")[0];i.parentNode.insertBefore(n,i)}}("Treasure",this); | |
| var td = new Treasure({ | |
| host: "in.treasuredata.com", | |
| writeKey: "TD_API_KEY", | |
| database: "TD_DB_NAME" | |
| }); |
This file contains hidden or 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
| #!/bin/sh | |
| # | |
| # td command option | |
| # -d : database name | |
| # -w : waiting | |
| # --output : output file name to local | |
| # -f : file format | |
| # -c : add column name (top line) | |
| mode=$1 |
This file contains hidden or 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
| -- INSERT INTO id_mapping -- presto | |
| With ssuid_table as | |
| ( | |
| select | |
| td_global_id | |
| ,max(ssuid) as ssuid | |
| from tmp_id_mapping | |
| group by td_global_id | |
| ), | |
| cluid_table as |
This file contains hidden or 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
| SELECT | |
| ssuid, | |
| cluid | |
| FROM | |
| id_mapping | |
| WHERE | |
| ssuid IS NOT NULL | |
| AND cluid != '0' |
This file contains hidden or 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
| -- INSERT INTO id_mapping -- Presto | |
| With ssuid_table as | |
| ( | |
| select | |
| fp_id | |
| ,max(ssuid) as ssuid | |
| from tmp_id_mapping | |
| group by fp_id | |
| ), | |
| cluid_table as |
This file contains hidden or 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
| -- INSERT INTO id_mapping -- Presto | |
| With ssuid_table as | |
| ( | |
| select | |
| session_id | |
| ,max(ssuid) as ssuid | |
| from tmp_id_mapping | |
| group by session_id | |
| ), | |
| cluid_table as |
This file contains hidden or 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
| //TD library | |
| !function(t,e){if(void 0===e[t]){e[t]=function(){e[t].clients.push(this),this._init=[Array.prototype.slice.call(arguments)]},e[t].clients=[];for(var r=function(t){return function(){return this["_"+t]=this["_"+t]||[],this["_"+t].push(Array.prototype.slice.call(arguments)),this}},s=["addRecord","set","trackEvent","trackPageview","trackClicks","ready"],a=0;a<s.length;a++){var c=s[a];e[t].prototype[c]=r(c)}var n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src=("https:"===document.location.protocol?"https:":"http:")+"//cdn.treasuredata.com/sdk/1.7.1/td.min.js";var i=document.getElementsByTagName("script")[0];i.parentNode.insertBefore(n,i)}}("Treasure",this); | |
| // Setup parameter(1-4) | |
| var td = new Treasure({ | |
| host: 'in.treasuredata.com', | |
| writeKey: 'TD_API_KEY', //1,TD API KEY | |
| database: 'TD_DB_NAME' //2,TD Database Name | |
| }); | |
| var td_table_name = 'TD_TABLE_NAME', //3,TD Table Name | |
| im_token = 'IM_TOKEN'; // 4,IntimateMerger parameter |
This file contains hidden or 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 _tdOptions = { | |
| initParams : { | |
| host: 'in.treasuredata.com', | |
| writeKey: 'YOUR_WRITE_KEY', | |
| database: 'DATABASE_NAME' | |
| }, | |
| table : 'TABLE_NAME', | |
| imToken : 'YOUR_IM_API_TOKEN', | |
| // customParam : {type:"customedata"} //customeデータがある場合に利用 |
This file contains hidden or 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 _tdOptions = { | |
| initParams : { | |
| host: 'in.treasuredata.com', | |
| writeKey: 'YOUR_WRITE_KEY', | |
| database: 'DATABASE_NAME' | |
| }, | |
| table : 'TABLE_NAME', | |
| imToken : 'YOUR_IM_API_TOKEN', | |
| // customParam : {type:"customedata"} //customeデータがある場合に利用 |