In this article, you’ll learn how to set up Jornaya-LeadId inside LeadsHook.
Learn more about meeting your TCPA compliance using Jornaya-LeadsId here:
https://www.jornaya.com/the-data/leadid/
1. First copy/paste your leadID script into the global level or decision tree level scripts section.

Note: If you place the script at the global level, make sure to enable it on the decision tree level.
2. Create a custom field called “leadid_token” ( Type: text, visible: no, required: no )

3. Copy/paste this script into any node-level script section.
<input id="leadid_token" name="leadid_token" type="hidden" value="" />
<script>
// starts a loop with interval of 500ms
var loop = setInterval(getToken, 500)
function getToken() {
var leadId = document.getElementById('leadid_token').value;
// check if token has been generated
if (leadId){
// assign the generated token to LH custom field
DT.setField('leadid_token', leadId);
// logs the token to the console
console.log(leadId);
// stops the loop
clearInterval(loop);
}
}
</script>


Now test with the browser console. You should see the leadID populate.

The leadID is saved in the {leadid_token} custom field. You can use it when mapping your fields, webhooks, email, etc.