# Updating Parameters
That code is compatible with Local, Preloaded and External landing pages.
Insert that script to the HTML code of the landing page:
<script type="text/javascript">
function updateParams(toUpdate) {
var toUpdateParams = new URLSearchParams(toUpdate);
var params = new URLSearchParams(document.location.search.substr(1));
if (!'{subid}'.match('{')) {
params.set('_subid', '{subid}');
}
var clientSubid = '<?= echo isset($client) ? $client->getSubid() : "" ?>';
if (!clientSubid.match('>')) {
params.set('_subid', clientSubid);
}
var img = document.createElement("img");
img.src = 'https://TRACKER_DOMAIN/?_update_tokens=1&sub_id=' + params.get('_subid') + '&return=img&' + toUpdateParams.toString();
img.height=0;
img.width=0;
document.getElementsByTagName("body")[0].appendChild(img);
}
</script>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Replace TRACKER_DOMAIN
to the tracker domain.
Example:
<script type="text/javascript">
updateParams('sub_id_8=some.name@gmail.com')
// or updateParams({sub_id_8: 'some.name@gmail.com'})
</script>
1
2
3
4
2
3
4
Example of updating multiple parameters:
<script type="text/javascript">
updateParams('sub_id_8=some.name@gmail.com&sub_id_9=10')
// or updateParams({sub_id_8: 'some.name@gmail.com', sub_id_9: 10})
</script>
1
2
3
4
2
3
4
That code is compatible with Local, Preloaded and External landing pages and KClient PHP.
Insert that code the PHP file of the landing page:
function updateParams($params) {
$subId = isset($_REQUEST['subid']) ? $_REQUEST['subid'] : null;
if (isset($_REQUEST['_subid'])) {
$subId = $_REQUEST['_subid']
}
file_get_contents('https://TRACKER_DOMAIN/?_update_tokens=1&sub_id=' . urlencode($subId)) . '&' . http_build_query($params);
}
1
2
3
4
5
6
7
2
3
4
5
6
7
Change TRACKER_DOMAIN
to the tracker domain.
Example:
updateParams(array(
'sub_id_1' => 'info@gmail.com'
))
1
2
3
2
3
Example of updating multiple parameters:
updateParams(array(
'sub_id_1' => 'info@gmail.com'
'sub_id_2' => 'Max Payne'
))
1
2
3
4
2
3
4
# Alternatives
Keitaro updates the parameters in other endpoints: