Identifying users and triggering events using Instapage

Requirements before proceeding.

In general, to understand how to identify visitors and to trigger events, please visit: How to set journey properties in JS

We'll further assume the following:
website: site.com
www website is supported! www.site.com
Advanced URL is track.site.com
https is supported!


Adding the snippet to the page to record the page view

Add the following code in Settings > Javascript, body section of your landing page::

<script src="https://track.site.com/tracker.js" async></script>
<script>
window.journy=window.journy||function(_,n,o){window.__journy_queue__||(window.__journy_queue__=[]),window.__journy_queue__.push({command:_,args:n,date:Date.now(),callback:o})};
journy("init", { trackerId: "your-journy-ID", domain: "https://track.site.com" });
journy("pageview"); /*record the page view! */
</script>


You'll need to change your-journy-ID to your. actual journy-ID, and your Advanced URL to your own as well.
But the simplest way is to copy-paste the whole code from your journy.io business setting menu.

Identifying visitors and/or triggering event when submitting Instapage forms.

Add the following code in Settings > Javascript, body section of your landing page::

<script>
window.instapageFormSubmitSuccess = function (form) {

// Get values from form fields
var inputEmail = window.__page_generator ? form.querySelector('input[name="' + 'Email' + '"]').value : form.querySelector('input[name="' + base64_encode('Email') + '"]').value;

if(inputEmail) {
console.log("Submitted " + inputEmail);
journy("identify", { email: inputEmail, score: 25 }); /*identifying the user! */
journy("event", { tag: "Instapage Form Submit" }); /*trigger an event! */
}
})
</script>


You need to set the page recording snippet before being able to identify a visitor or trigger an event!
Was this article helpful?
Cancel
Thank you!