Skip to content

Instantly share code, notes, and snippets.

View Quay3's full-sized avatar

Quay3

  • Saturday Drive
View GitHub Profile
@Quay3
Quay3 / gist:02443d3cdb35d6484919b0c245eb539b
Last active April 3, 2023 16:54
Form Submission Custom HTML Tag for GTM
<script>
jQuery(document).ready( function() {
jQuery(document).on('nfFormSubmitResponse', function(event, response, id) {
dataLayer.push ({
'event' : 'ninjaFormSubmission',
'NFformID' : response.id
});
});
});
</script>
<?php
/*
Plugin Name: Custom Redirect
*/
function my_custom_redirect () {
global $post;
if ( is_page() || is_object( $post ) ) {
if ( $redirect = get_post_meta($post-&gt;ID, 'redirect', true ) ) {
wp_redirect( $redirect );
<?php
/*
Plugin Name: Custom Redirect
*/
<a href="https://ninjaforms.com/" target="_blank" class="button">Click Me</a>
<style>
.button {
display: block;
height: 25px;
width: 75px;
background: #32CD32;
text-align: center;
border: 2px solid rgba(33, 68, 72, 0.59);
}
if( !defined( 'INSIGHTLY_RECORDS_TO_RETURN' ) ){
define( 'INSIGHTLY_RECORDS_TO_RETURN' , 500 );
}
if( !defined( 'INSIGHTLY_API_VERSION' ) ){
define( 'INSIGHTLY_API_VERSION' , '2.1' );
}
[facebook https://www.facebook.com/yourevent/]
[fb_plugin page href=”https://www.facebook.com/yourpage” tabs=”events”]
<script>
jQuery( document ).ready( function() {
jQuery( document )
.on('click', '#nf-field-26', function() {
ga('send', 'event', 'Email List', 'Subscribed', 'New Subscriber');
});
});
</script>
<script>
jQuery( document ).ready( function() {
jQuery( document )
.on('click', 'input[type=button]', function() {
ga('send', 'event', 'Email List', 'Subscribed', 'New Subscriber');
});
});
</script>