Find out how to integrate NetFUNNEL to control your home page, the first thing your users will see.
Main page control technical overview
Instead of directly accessing the main page from the outside, you can control the inflow to the main page itself by applying the NetFUNNEL waiting page instead of the existing main page.
-
It operates in the flow of external → NetFUNNEL waiting page (index.html) → existing main page (index_real.html).
How to apply
- Change index.html (the original main page) to index_real.html, and apply the HTML file to be used as the NetFUNNEL waiting page to index.html.
- Install the Agent by inserting the tag Code Snippet in index.html.
- Call the Surffy_Action API as the callback function of the load event.
- Please refer to How to integrate API
If you are using the path control feature from the main page, you will also need to insert the code snippet into the html of the endpoint.
Development guide
Parameter
- url(string) *Required
- The URL to be subject for processing entry completion. If it matches the URL registered in the console, it requests entry to the NetFUNNEL server. Otherwise, the callback function passed as the second argument is executed immediately.
- callback(function) *Optional
- Please refer to the application example below and write a code that moves to the URL of the existing main page.
- Sample
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>List</title>
<script>
(function(w,d,s,uri,fn){
w[fn] = w[fn] || function(){ var c = {}; c.tenantApiUrl = arguments[0]; c.tenantNFUrl = arguments[1]; (w[fn].l = w[fn].l || []).push(c); };
var o = d.createElement(s); var p = d.getElementsByTagName(s)[0]; o.async = 1; o.charset = 'utf-8'; o.src = uri; p.parentNode.insertBefore(o,p);
})(window,document,'script','https://agent-lib.surffy-dev.io/surffy-agent_latest.js','nfTag');
nfTag('https://surffy-demo.surffy.io/nf-setting.json', 'https://surffy-demo.surffy.io');
window.addEventListener('load',
function() {
// eslint-disable-next-line no-undef
Surffy_Action('https://surffy.io/main', function() {
location.href = 'https://surffy.io/main';
})
}
);
</script>
</head>
<body>
...
Agent application testing
If you want to check if NetFUNNEL Web Agent has been successfully applied, follow the steps below.
- Set the limited inflow of basic control segment to '0'
- Request to enter the web page according to the applied method (basic dynamic traffic control/API direct call/main page)
- Check if the waiting room (page) appears on the screen (check VWR)
- Check if there is a change in the value of the corresponding segment within the basic control of the Surffy NetFUNNEL console (check EUM)
Comments
0 comments
Please sign in to leave a comment.