Appian

Appian SDK

アプリケーションのインストルメンテーションを開始する前に、Pyze から App Key を受け取っていることを確認してください。

インストール

Appian AppMarketからPyze Ananytics Componentをインストールし、プラグインのリストで有効になっていることを確認します。

初期化

アプリケーションでは、アプリケーションのページからこのコンポーネントに簡単にアクセスできるようにするために、Pyze Analytics Component用の共通の式ルール(例:PDPyze)を作成します。

次のコードを Expression Rule Component の中に貼り付けます。

/*Use the App Key provided by Pyze */
{
   pyze(
      pyzeAppKey: "YOUR_PYZE_APP_KEY",
      methodName: ri!methodName,
      eventName: ri!eventName,
      attributes: ri!attributes,
      userId: ri!userId,
      pyzeProfileAttributes: ri!pyzeProfileAttributes,
      customProfileAttributes: ri!customProfileAttributes,
      /*randomString: (rand()-0.5)/500*/
   )
}

入力変数methodName、eventName、attributes、userId、pyzeProfileAttributes、customProfileAttributesを以下のように作成します。

initializeの呼び出しは、トラッキングしたいページごとに必要です。

これにより、ページがロードされたときに初期化メソッドが起動され、pyze SDKがデータの収集を開始します。

local!methodName : "initialize",
local!eventName : "",
local!attributes : {},
local!userId:"",
local!pyzeProfileAttributes:{},
local!customProfileAttributes:{},

アプリケーションの各インターフェースに表現ルールを追加します。

rule!PDPyze(
   methodName: local!methodName,
   eventName:  local!eventName,
   attributes: local!attributes,
   userId: local!userId,
   pyzeProfileAttributes: local!pyzeProfileAttributes,
   customProfileAttributes: local!customProfileAttributes
)

オプションとして、そのページでバリブルを使用しない場合は省略することができます。例: プロファイル API を呼び出さない場合、上記のスニペットは次のようになります。

/*
* Local variables
*/
local!methodName : "initialize",
local!eventName : "",
local!attributes : {},

...

/*
* Component with fewer variables.
*/
rule!PDPyze(
   methodName: local!methodName,
   eventName:  local!eventName,
   attributes: local!attributes
)