Skip to main content
Tangiblee
 > 
Help Center
 > 
 > 

Callback Events

Tangiblee Events

onSKUsValidated (onSKUsValidated:function)

Can be used to set a callback executed each time when Tangiblee API request is completed

Parameter

Type

Description

onSKUsValidated

function

a callback to be executed on each Tangiblee API request completing.

tangiblee('onSKUsValidated', function(atLeastOneSKUIsValid) { console.log('At least one SKU is valid: ' + atLeastOneSKUIsValid); });

onCTAShown (onCTAShown:function)

Can be used to set a callback when Tangiblee CTA is shown.

Parameter

Type

Description

onCTAShown

function

a callback to be executed when Tangiblee CTA is shown.

tangiblee('onCTAShown', function() { console.log('Tangiblee CTA shown!'); });

onCtaClicked (onCtaClicked:function)

Can be used to set a callback for each Tangiblee CTA click.

Parameter

Type

Description

onCtaClicked

function

a callback to be executed on each Tangiblee CTA click.

tangiblee('onCtaClicked', function() { console.log('Tangiblee CTA clicked!'); });

onModalOpened (onModalOpened:function)

Can be used to set a callback for each Tangiblee modal opening.

[.bad]NOTE: In case you wish to track when Tangiblee UX popup opens, we recommend to rely on this event and not on onCtaClicked(), since the latter might not be 100% accurate in case there are CSS or js conflicts on the PDP.[.bad]

Parameter

Type

Description

onModalOpened

function

a callback to be executed on each Tangiblee modal opening.

tangiblee('onModalOpened', function() { console.log('Tangiblee modal opened!'); });

onIframeLoaded (onIframeLoaded:function)

Can be used to set a callback for each Tangiblee iframe loading.

Parameter

Type

Description

onIframeLoaded

function

a callback to be executed on each Tangiblee iframe loading.

tangiblee('onIframeLoaded', function() { console.log('Tangiblee iframe loaded!'); });

onModalClosed (onModalClosed:function)

Can be used to set a callback for each Tangiblee modal closing.

Parameter

Type

Description

onModalClosed

function

a callback to be executed on each Tangiblee modal closing.

tangiblee('onModalClosed', function(timeInWidget) { console.log('Tangiblee modal closed! Time in widget', timeInWidget); });

onKeepAlive (onKeepAlive:function)

Can be used to set a callback for ping (every 5sec) Tangiblee widget if it's still active.

Parameter

Type

Description

onKeepAlive

function

a callback to be executed on each Tangiblee widget ping (every 5sec).

tangiblee('onKeepAlive', function() { console.log('Widget ping'); });

onUserInteracted (onUserInteracted:function)

Can be used to set a callback for first Tangiblee user interaction.

Parameter

Type

Description

onUserInteracted

function

a callback to be executed on the first Tangiblee user interaction.

tangiblee('onUserInteracted', function() { console.log('User interacted'); });

onATCClickInWidget (onATCClickInWidget:function)

Can be used to set a callback for every time the Add-to-Cart CTA is clicked within Tangiblee popup.

Parameter

Type

Description

onATCClickInWidget

function

a callback to be executed on each Tangiblee Add to Cart click.

tangiblee('onATCClickInWidget', function() { console.log('product added to cart'); });