Skip to content

Instantly share code, notes, and snippets.

View cmorss's full-sized avatar

Charlie Morss cmorss

View GitHub Profile
@victorres11
victorres11 / instapage-segment.js
Last active December 2, 2021 01:06
Segment integration code to be used on Instapage
// callback to trigger code upon a landing page form submit - the main call to action.
window.instapageFormSubmitSuccess = function( form ){
// Instapage is a bit quirky with how it captures values of the form submit, but you should be able to use this code and replace the form fields with whatever your page is capturing.
var firstName = ijQuery( form ).find( 'input[name="' + window.base64.base64_encode( 'First Name' ) +'"]').val();
var lastName = ijQuery( form ).find( 'input[name="' + window.base64.base64_encode( 'Last Name' ) +'"]').val();
var email = ijQuery( form ).find( 'input[name="' + window.base64.base64_encode( 'Email') +'"]').val();
// Segment identify call.
analytics.identify(email, {
firstName: firstName,