如何手动触发 ForeSee 调查对话框以使用 javascript 显示?或网址参数

How can I manually trigger a ForeSee survey dialog to display with javascript? or URL parameters?

本文关键字:显示 javascript 参数 何手动 ForeSee 调查 对话框      更新时间:2023-09-26

我找不到任何关于ForeSee的API文档,并且我收到了与随机显示的ForeSee调查提示对话框相关的错误报告。我尝试清除缓存和cookie,但它还没有为我显示,有没有办法用javascript触发它的显示?或者也许使用某些 URL 参数?

foresee-trigger.js中,我更新了FSR.sites数组以包含对本地主机的引用:

var FSR = {
    'version': '7.0.0',
    'date': '01/01/2011',
    'enabled': true,
    'auto' : true,
    'encode' : true,
    'files': './foresee/', //default path when no match below         
    'id': 'etc',
    'sites': [
    /* several existing ones, etc.*/
    {
        name: 'localhost',
        path: 'localhost',
        files: '//localhost/subdirectory/foresee/',
        domain: 'localhost'
    },{
        path: '.',
        domain: 'default'
    }]
};

您应该能够通过点击"fsradmin.html"页面来手动设置当前会话的采样百分比,该页面应与 foresee-trigger.js 文件位于同一目录中。 例如,localhost/YourApp/scripts/foresee/fsradmin.html。 将抽样百分比设置为 100% 将确保您遇到调查。

另一种选择是在此处更改 foresee-surveydef.js 文件中的实际抽样百分比:

标准:{

   sp: 75,  //this is the sampling % - set it to 100 to ensure that it appears
   lf: 1  // loyalty factor, (the # of pages the user has to hit before it appears)

},

如果选择第二个选项,请确保在部署代码之前将采样百分比设置回原始值,否则每个人都将始终收到调查。

最后,这是他们文档的链接:http://demo.foreseeresults.com/_code/docs/ForeSee_Trigger_Code_Implementation_Guide.pdf

FSR.showInvite();仅当尚未向用户显示 Foresee 时,它才会显示,这意味着尚未创建 cookie。如果要验证,请先清除缓存。加载编写预见代码的页面,并在开发人员控制台中触发上述命令。它将显示调查对话框。