Steps for integrating into website / web app / mobile app.
Copy the below code in the appropriate location of your webpage / web app / mobile app to embed the Fletch Insurance Widget (FIW). Height and width iFrame parameters are fully customizable.
// Replace the #PARTNERCODE# in the below string with the partner code. To get the partner code, please contact Fletch ([email protected])
Sandbox
For Sandbox environment, the code snippet would be
<iframe id="ifVCFrame" src="https://#PARTNERCODE#-wsb.fletch.co/" width="100%"
height="400px" style="border: 0px !important;"></iframe>
Production
For Production environment, the code snippet would be
<iframe id="ifVCFrame" src="https://#PARTNERCODE#-wp.fletch.co/" width="100%"
height="400px" style="border: 0px !important;"></iframe>
Widget Display Types
The widget is optimized for 400px height.
Example widget source URL: <https://#PARTNERCODE#-wsb.fletch.co>
Appending Customer Data:
Partners have the ability to pass customer data. This can be used to pre-fill the widget.
There are multiple ways to implement this; however, passing customer data is completely optional and does not affect widget functionality.
Query parameters is the set of key value pairs appended to the widget URL. The URL is appended with a ?key={value} and separated by & for multiple key value pairs.
Approach 1: Sending data from widget URL:
Use case: If widget is the full page redirect experience for partner
Fletch Hosted Widget URL:
<https://#PARTNERCODE#-wp.fletch.co/?key1={value1}&key2={value2}&key3={value3}>
<https://#PARTNERCODE#-wp/?customer_fname=Andrew&customer_lname=Miller>
Example Query Parameters:
Key | Value |
---|---|
customer_fname | Customer first name |
customer_lname | Customer last name |
customer_email | Customer email ID |
customer_phone | Customer phone number. Value should contain 10 digits |
customer_birth_date | Customer date of birth in MM/DD/YYYY format |
building_street_number | Building number of the property getting insured |
street_route_name | Street name of the property getting insured |
city_locality | City of the property getting insured |
country | Country code of the property getting insured. For example, US for country USA |
zip_code | 5-digit valid US zip code |
apartment_number | Apartment number (required if applicable) |
Approach 2: Sending data from client URL web page:
Use case: Redirect out to a separate landing page containing the widget
Partner Hosted Website:
<https://#PARTNERWEBSITE#/fletch/?key1={value1}&key2={value2}&key3={value3}>
<https://#PARTNERWEBSITE#/fletch/?customer_fname=Andrew&customer_lname=Miller>
Fletch Hosted Partner Landing Page:
https://fletch.co/#PARTNERCODE/?key1={value1}&key2={value2}&key3={value3}
https://fletch.co/#PARTNERCODE/?customer_fname=Andrew&customer_lname=Miller
Example Query Parameters:
Key | Value |
---|---|
customer_fname | Customer first name |
customer_lname | Customer last name |
customer_email | Customer email ID |
customer_phone | Customer phone number. Value should contain 10 digits |
customer_birth_date | Customer date of birth in MM/DD/YYYY format |
building_street_number | Building number of the property getting insured |
street_route_name | Street name of the property getting insured |
city_locality | City of the property getting insured |
country | Country code of the property getting insured. For example, US for country USA |
zip_code | 5-digit valid US zip code |
apartment_number | Apartment number (required if applicable) |
Please add the following script after the iFrame code:
<script>
var iframe = document.getElementById("ifVCFrame")
if(typeof(iframe) != 'undefined' && iframe != null && window.location.search!= ''){
var url = (iframe.src)
var addQueryParam = url+window.location.search
iframe.src= addQueryParam
}
</script>
Approach 3: Sending data from partner web application or mobile application:
Use case: Ecosystem partner application and Fletch widget reside on the same page
Please add the following script after the iFrame code
<script>
var iframe = document.getElementById(‘ifFLFrame’)
if(typeof(iframe) != 'undefined' && iframe != null ') {
var url = iframe.src
var addQueryParam = url?key1="+{value1}+"&key2="+{value of key2}+"&key3="+{value of key3}"
iframe.src= addQueryParam
}
</script>
Example Query Parameters:
Key | Value |
---|---|
customer_fname | Customer first name |
customer_lname | Customer last name |
customer_email | Customer email ID |
customer_phone | Customer phone number. Value should contain 10 digits |
customer_birth_date | Customer date of birth in MM/DD/YYYY format |
building_street_number | Building number of the property getting insured |
street_route_name | Street name of the property getting insured |
city_locality | City of the property getting insured |
country | Country code of the property getting insured. For example, US for country USA |
zip_code | 5-digit valid US zip code |
apartment_number | Apartment number (required if applicable |
Copyright Fletch Technologies, Inc. 2024