Onsite API

The following APIs are called using window.KAMPYLE_ONSITE_SDK.API;. For example, window.KAMPYLE_ONSITE_SDK.loadForm(5); loads the form with formId number 5.

API Name

Description

updatePageView

Starts a new targeting session. Would probably be implemented in SPAs

stopLogger

Sets local storage variable mdLogger to FALSE.

Once turned off, logs are not collected.

startLogger

Sets local storage variable mdLogger to TRUE.

Once turned on, all logs are written to a private variable.

startInviteTargeting

Usually targeting runs for all form types once the onsite script is loaded,

This feature prevents targeting for invite on load, and it is executed on demand by the customer using this API.

Important: This feature is available upon request. Ask your Medallia expert to file a Feature activation request with Medallia Support.

showForm(formId, options)

Loads and displays the specified form. Can pass an options object to the form

printMdigitalLogs

Prints all the logs collected from the moment startLogger API was called.

loadForm(formId)

Loads the specified form into view identified by its formId

isSurveyDisplayed

Returns true if there is an open survey (form) or intercept (invite)

closeForm(value)

Closes form/s based on the following values:

formId - Closes the specific form identified by the form ID.

all - Closes all open forms.

embedded - Closes all open embedded typed forms.

modal - Closes the open modal form, whether it is animation or lightbox.

Returns true if at least one form was closed.

collectIntegrationData(integrationName)

Where integrationName is:

contentSquare

clickTale

glassbox

sessionCam

tealeaf

decibelInsight

userReplay

fullStory

quantumMetrics

For Digital Experience Analytics (decibelInsight) integration it's also used for making sure the session-id is updated correctly. It should be called after the integration has initialized in case the form was loaded before that.