Page Manipulation SDK
The Page Manipulation SDK provides simple, familiar HTML constructs while encapsulating HTTP networking, asynchronous cloud processing, and dynamic HTML rendering.
It ensures optimal Intelligent Page implementations with minimal engineering effort.
Getting Started
- Insert the Intelligent Tag.
- Review the Intelligent Handshake® Plan and identify target HTML Elements.
- Choose an Implementation Mode (HTML Orchestration or JavaScript Callback).
- Define the Default Experience.
- Prepare the target HTML Elements.
- Create Intelligent Handshake® HTML Script Elements.
- Create the Page Plan Object.
- Start Manipulation Mode
- Test different user experiences with URL parameters.
Review the Intelligent Handshake® Plan
As the integration engineer, you’ll receive an Intelligent Handshake® Plan. This plan describes how to enhance the page experience while meeting business objectives.
- Study the plan carefully to understand its goals.
- Map each step of the plan to specific HTML elements on your site.
- Visualize the full journey: the default state (before), the change (transition), and the personalized result (after).
This ensures that the intended user experience is implemented accurately and consistently.
Implementation Options
The SDK supports two rendering modes:
HTML Orchestration Mode
Declarative. Controlled entirely through the Page Plan Object.
Recommended for most implementations.
JavaScript Callback Mode
Programmatic. Controlled by your custom callback.
Use when you need flexibility (analytics, dynamic rendering, third-party integrations)
Both modes can be used together.
Define the Default Experience
The Internet isn’t always predictable.
A well-defined Default Experience ensures that the page remains usable and positive in every scenario, even if network conditions or responses vary.
Two primary approaches can be mixed across multiple elements of a page:
Server Default Render
- The server renders the default HTML as-is.
- The Page Manipulation SDK does not alter these elements.
Manipulation Default Render
- The server renders an empty placeholder or simple default markup.
- The Page Manipulation SDK injects or replaces this content once the Score Rendering is Triggered.
Prepare the Target HTML Elements
Manipultion IDs
Each target element in the Intelligent Handshake® Plan must have a unique id. You can use existing IDs or add new ones as needed.
Visibility IDs
Both of the following can act as visibility triggers that start the rendering process when they first become visible in the viewport:
- elementPlans.elementIDs — one or more target element IDs defined within each Element Plan.
- triggerElementID — an optional, additional element ID at the Page Plan level.
When any one of these elements becomes visible, Intelligent Handshake® evaluates the user’s Score and begins rendering the appropriate experience.
Example
<div id="wrapper"></div> <!-- optional PagePlan triggerElementID -->
<div id="offer"></div> <!-- part of elementPlans.elementIDs -->
This design ensures you can control rendering based on either the primary elements you’re manipulating or a dedicated “trigger” element.
Create Intelligent Handshake® HTML Script Elements
A custom <script> type was created for defining manipulation experiences in native HTML:
Example
<script type="html/intelligenthandshake" id="IH_Hero_H" ...>
...
<div>
...
</div>
...
</script>
These elements are invisible to the browser but available to the SDK for orchestration.
This lets developers design experiences using familiar HTML in their normal tools.
Create Page Plan Object
The Page Plan Object links Intelligent Handshake® Scores to the experiences defined in HTML or code.
It is a JavaScript configuration object that drives the Page Manipulation SDK.
Page Plan Object Definition
| Field |
Data Type |
Examples |
Description |
| actionKey |
String |
"0123a...XyZ==" |
Intelligent Handshake assigned ActionKey. |
| triggerElementID |
String |
|
Optional. Additional element ID that, when visible, triggers rendering. |
| triggerVisiblityThreshold |
Number |
0.01 |
Optional. Percentage of first visibility trigger element to trigger rendering (0.01 to 0.5). |
| onRender |
Entry point for Callback function |
SimpleShowScoreOverlay |
Optional callback. Enables JavaScript Callback Mode. onRender( PagePlan, Segment ) |
| elementPlans |
Array of ElementPlan Objects |
[{...},...] |
Zero or more Element Plan objects. |
Element Plan Object Definition
| Field |
Data Type |
Examples |
Description |
| elementIDs |
Array of Strings |
["id151841-409", "id151841-52"] |
Array of target element IDs. |
| defaultMode |
String |
"None" |
Manipulation Mode for the Default Experience (Default is "None"). |
| defaultHTMLID |
Number |
null |
Optional ID of the default content. |
| HTMLScores |
Array of Objects |
[{...},...] |
Array of objects defining Score-based manipulations. |
HTML Score Object Definition
| Field |
Data Type |
Examples |
Description |
| score |
String |
"H" |
Intelligent Handshake® Scores (e.g. "H"). |
| mode |
String |
"Append" |
Manipulation mode for the experience (Append, Replace). |
| HTMLID |
String |
IH_HERO_H |
ID of the HTML snippet (<script type="html/intelligenthandshake">). |
Segment Object Definition
| Field |
Data Type |
Examples |
Description |
| segmentCode |
String |
H |
Intelligent Handshake® Scores. |
| nominalIndex |
String |
6 |
Unique numeric index of Score, not in any specific order. |
| quantitativeValue |
String |
3.0 |
A relative value of score which can be used for comparison in certain cases. |
Manipulation Modes
None - Do nothing
Append - Add manipulation content after existing HTML
Replace - Replace existing HTML with manipulation content
Example
<script type="text/javascript">
theIntelligentHandshakePagePlan =
{
defaultTimeoutAfterLoad: 10,
actionKey: "0123a...XyZ==",
triggerElementID: "id517024-3232",
triggerVisiblityThreshold: 0.01,
onRender: SimpleShowScoreOverlay,
elementPlans:
[
{
elementIDs: ["id151841-409", "id151841-52"],
defaultMode: "None",
defaultHTMLID: null,
HTMLScores: [
{
score: "H",
mode: "Append",
HTMLID: "IH_Hero_H"
}
]
}
]
}
</script>
Start Manipulation Mode
The following snippet should be added after the theIntelligentHandshakePagePlan object is defined.
This snippet registers your Page Plan with the Intelligent Handshake SDK.
Example
<script type="text/javascript">
(function(p){(function c(k){if(window.intelligenthandshake?.ManipulationMode?.Start){intelligenthandshake.ManipulationMode.Start(p)}else if(k<100){setTimeout(()=>c(k+1),50)}})(0)})
( theIntelligentHandshakePagePlan );
</script>
Test the User Experience
You can test scenarios using query parameters on the Intelligent Tag URL.
Example
https://livesite.com/?ihscore=L
https://livesite.com/?ihscore=M
https://livesite.com/?ihscore=H
https://livesite.com/?ihscore=NB
https://livesite.com/?ihscore=H&ihmilliseconds=0
https://livesite.com/?ihscore=H&ihmilliseconds=300
https://livesite.com/?ihscore=H&ihmilliseconds=1000
These allow you to simulate different Intelligent Handshake® Scores and response times for end-to-end testing.
Summary
- Use HTML Orchestration Mode for declarative, markup-based experiences.
- Use JavaScript Callback Mode for full control.
- Always define a Default Experience.
- Test with query parameters to validate before launch.