Created
June 11, 2015 18:25
-
-
Save aaroneaton/30f14fe6dadea04fca18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
// We want to store a global reference to the proper optin object to make use of tracking methods. | |
var om_ref; | |
jQuery(document).ready(function($){ | |
// Gain access once the entire object is loaded. | |
$(document).on('OptinMonsterLoaded', function(e, props, obj){ | |
// Replace jshdgfgshf with the unique optin slug you want to target. | |
if ( 'uv7nlvrd513vds1n' == obj.getProp('optin') ) { | |
om_ref = obj; | |
} | |
}); | |
// Register click handler to trigger the success call. | |
$(document).on('click', '.optin-lead-link', function(){ | |
om_ref.trackEvent('conversion', om_ref.getProp('ga_campaign'), om_ref.getProp('ga_campaign_id')); | |
}); | |
}); | |
</script> |
Hey Juan,
We haven't removed that method from our API. You may want to add a check for that om_ref
object before creating the conversion.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi J. Aaron, it seems the trackEvent method is no longer supported, which method shelled we use now?