← Back to DataWidget® Home
Live Demo

Try the DataWidget®

This is a working embed using the same script your website would load. Events are logged below.

Embedded Widget

Callback Log

Events received from the widget are displayed here in real time.

Waiting for widget events...

Integration Code

Old Way (LeadsPlease Widget 1.5)

<script src="http://test.leadsplease.com/lp_widget_1.5.js"></script> <script> var w = new LeadsPlease.Widget({ widgetid: 'my_widget', affiliatecode: 'ABC', conclusionurl: 'http://www.example.com/listnotify', sessionid: '123456789' }); </script> <div id="my_widget"></div>
vs

New Way (DataWidget® 2.0 — drop-in replacement)

// Just change the script URL. Everything else stays the same. <script src="https://thedatawidget.com/embed/sg_widget_2.0.js"></script> <script> var w = new LeadsPlease.Widget({ widgetid: 'my_widget', affiliatecode: 'ABC', conclusionurl: 'http://www.example.com/listnotify', sessionid: '123456789', callback: function(data) { console.log(data); }, onload: function() { console.log('Widget ready'); } }); </script> <div id="my_widget"></div>

Or use the new SalesGarden namespace

<script src="https://thedatawidget.com/embed/sg_widget_2.0.js"></script> <script> var w = new SalesGarden.Widget({ widgetid: 'my_widget', affiliatecode: 'ABC', sessionid: '123456789', callback: function(data) { console.log(data); } }); </script> <div id="my_widget"></div>

Constructor Parameters

Parameter Type Description
widgetid required string The id of the HTML element where the widget iframe will be inserted.
affiliatecode required string Your affiliate or partner code (e.g. 'lp', 'ABC'). Determines branding and pricing.
sessionid optional string A session identifier for tracking. Passed back in the conclusion callback.
conclusionurl optional string Server-side URL that receives a POST when the user completes a list selection.
callback optional function JavaScript function called on conclusion. Receives { criteriaid, listtype, price, qtycount, qtydesired, sessionid }.
onload optional function JavaScript function called when the widget iframe has finished loading.
skin optional object Skinning options: { buylistbtn: 'Custom Text', hideprices: true }.
datasetkey optional string Selects a specific dataset or list type to show in the widget.