For advanced users, you may want to tie our checkout overlay widget directly to a button on your own website. This is possible if you are familiar with HTML and Javascript.


Step 1

Import our javascript file at the top of your page, in the <head>


<script type="text/javascript" src="https://www.prekindle.com/js/pk-ew-mapper.js"></script> 


Step 2

Connect each element by ID.  It's important that the page be fully loaded before attempting to connect. This ensures the element exists at the time the script runs.  A common source of errors is javascript executing while the page content is still being downloaded and parsed.

We recommend that you attach a javascript function the the onload of the <body> tag.


 <body onload="initialize();"> 

 ...

</body> 


Then, add a javascript function to your page called initialize()


 <script> 

   function initialize()
   {
       pkconnect( "mybutton1", "24511045851513420" );
       pkconnect( "mybutton2", "24511045851513420" );
   }

</script> 


The string mybutton1 & mybutton2 is the id of the element you are connecting the checkout to.  The long ID above (24511045851513420) is the ID for the event in question. You can access this ID from any tracking link on the Promote tab of your event. We recommend making a new one for this purpose so you can isolate views & sales from this channel.


Your page will have an element somewhere , for example:


 <a id="mybutton1">Click Here</a>