Actions

Connect the Checkout Widget To An Element On Your Page

From Prekindle Help


Beta Feature

Connecting is a two-step process.


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. We can provide it for you when you are ready to get started. You can use the one above for testing purposes too.

Your page will have an element somewhere , for example:


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