あなたはまた、は、プロバイダの名前で何かをするイベントをonShareButtonClicked使用することができます。ここでは
はGigya Documentionリンクがあります。これはNativeログインボタン(Google /モバイル上のFacebook)では機能しませんが、ウェブ上で操作している場合は、必要な操作を行う必要があります。私は実際の例を添付しています(ページにGigya APIキーが必要です)。
// Create a div for the widget (or use an existing div on your page)
var newShareDiv = document.createElement('div');
newShareDiv.id='ShareDiv';
newShareDiv.setAttribute('style', 'position: absolute; z-index: 1000; margin: 0px auto; margin-top: 10px !important; width: 200px; height: 20px; background-color: yellow; border: 2 px solid red;')
document.body.appendChild(newShareDiv);
//
// Create the UserAction for sharing
var gigyaShareAction = new gigya.socialize.UserAction();
gigyaShareAction.linkBack = 'https://demo.gigya.com';
gigyaShareAction.userMessage = 'Check this out!';
//
// Define shareButtons
var shareButtons = 'Facebook, Twitter, LinkedIn, Messenger, share';
//
// Define the Share Bar Plugin's params object
var shareParams = {
userAction: gigyaShareAction,
showCounts: 'none',
containerID: 'ShareDiv',
scope: 'both',
privacy: 'public',
iconsOnly: true,
layout: 'horizontal',
noButtonBorders: false,
operationMode: 'simpleShare',
onShareButtonClicked : function(e) {
console.log(e.shareItem.provider);
},
shareButtons: shareButtons // list of providers
};
//
// Load the Share Bar Plugin:
gigya.socialize.showShareBarUI(shareParams);
これは、クリックされたプロバイダの名前は、あなたが代わりにVARを作成することができ、コンソールにログインしてから、どこかでそれを送ったり、データをGoogleアナリティクスのイベントを発生します。