Skip to content

Commit

Permalink
CK ga
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemKo7v committed Dec 24, 2017
1 parent aeb0c7b commit 81f2cbb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions extensions/CryptoKitties/js/cryptokitties.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ Ethplorer.Extensions.CryptoKitties = {
Ethplorer.Events.addHandler("ethp_showTxDetails_finish", Ethplorer.Extensions.CryptoKitties.onTxDetails);
Ethplorer.Events.addHandler("ethp_showAddressDetails_finish", Ethplorer.Extensions.CryptoKitties.onAddressDetails);
},
gaSendEvent: function(action){
if(Ethplorer.Config.ga && ('undefined' !== typeof(ga))){
ga('send', 'event', 'CryptoKitties', action);
}
},
onAddressDetails: function(addrData){
if(!addrData.cryptokitties) return;
Ethplorer.Extensions.CryptoKitties.gaSendEvent('addressDetails');
var limit = 2;
var address = addrData.address.toLowerCase();
$('#address-token-balances').parent().append('<div id="ck-loading" class="text-center">Loading CryptoKitties...</div>');
Expand Down Expand Up @@ -47,6 +53,7 @@ Ethplorer.Extensions.CryptoKitties = {
onTxDetails: function(txData){
var oTx = txData.tx;
if(oTx.to && (Ethplorer.Extensions.CryptoKitties.contract === oTx.to) && oTx.method){
Ethplorer.Extensions.CryptoKitties.gaSendEvent('txDetails');
var p = oTx.method.replace('(', ' ').replace(',', ' ').replace(')', '').split(' ');
var cmd = p[0];
$('.token-operation-type').text(cmd);
Expand Down

0 comments on commit 81f2cbb

Please sign in to comment.