Hi,
If you are embedding the GuidedTrack program with an iframe, you would not be using custom events. Instead, what you can do is to reload the program running in the iframe passing whatever information you need via url parameters.
This is a program that captures the name and last name of a person and greets them: https://www.guidedtrack.com/programs/16334/edit
Now, let's say that in your site there is another place where the person can enter their name and you want to pass it to your GuidedTrack program when they click a button. This is what the html code could look like:
<button onclick="myFunction()">Send name to GuidedTrack</button>
<iframe id='iframeid' src="http://www.guidedtrack.com/programs/ur9vkak/run" width="100%" height="600px"></iframe>
And this is the myFunction() code, which reloads the same program but assigning a value to the program variables userName and userLastName:
<script>
function myFunction() {
document.getElementById('iframeid').src = "http://www.guidedtrack.com/programs/ur9vkak/run?userName=Peter&userLastName=Jackson" ;
}
</script>
In the code of the GuidedTrack program, you can see that at the very beginning there is a *startup event:
*events
*startup
*if: userName
*goto: greeting
*reset
When you initially load the program but have not yet clicked the button, userName has not been defined so this block of code does nothing and the program goes on to asking the questions. Anytime that you click the external button, the program will reload and it will take the userName and userLastName that have been passed as url parameters (with values "Peter" and "Jackson"). When you do that, the code under *startup gets executed immediately so in this case, the program flow will go to the final greeting page.