觸發程序

新增在全域rtp物件的特定狀態上觸發函式的功能。

您必須是Web Personalization客戶,並在您的網站上部署RTP標籤,才能使用使用者內容API。

使用情況

rtp('triggerName', function_to_trigger);

參數
選用/必要
類型
說明
'triggerName'
必要
字串
方法名稱。
function_to_trigger
必要
功能
要觸發的函式。

使用者內容就緒觸發器

根據使用者位置設定自訂變數。 當「rtpUserContext」全域物件就緒時,會呼叫此函式。

rtp('userContextReady', function() {
    if (rtpUserContext.location.state == 'CA') {
        rtp('set', 'custom1', 'productA');
    }
});
recommendation-more-help
bb269a6d-047a-4bf7-9acd-23ad9a63dc59