Test Page – Frontier

Example page for Frontier to test a customer data form prior to the widget.  See bottom of page for developer notes to implement.

 

DEVELOPER NOTES:

This is an example page for Frontier to see an implementation of a customer form placed before the widget.  This is an example only.  It is expected that Frontier will develop this page and manage the security of the widget.  If Frontier wants to require a customer to complete data prior to showing the widget, this should be within Frontier’s control whether the customer sees the widget.

To avoid the user typing the address a second time, and also to meet Frontier’s requirements to have a unique identifier that is shared between Frontier and Vizaport for Analytics, these two parameters can be passed by the parent page to the Vizaport iFrame:

  • user_id – This is used by Vizaport to record a unique user ID, already known to Frontier (e.g. email) that will be shown in Analytics.
  • user_prompt – This is used by Vizaport to enter an initial prompted (e.g. address) when the widget is loaded.
Both of these fields are optional.  Should they be passed by Frontier, please construct Javascript that passes the parameters such as the following:


// JAVASCRIPT CODE
// Get the iFrame by ID
const iframe = document.getElementById('vizaportWidget');

// Message contents - user_id can be email in the case of Frontier
const message = {
user_id: email,
};

if (address.trim() !== "") {
message.user_prompt = address;
}

// Post message to iframe
iframe.contentWindow.postMessage(message, '*');