Skip to content

Instantly share code, notes, and snippets.

@ksnider
ksnider / facebook-wca-standard-events.html
Created February 26, 2016 12:03 — forked from danielmcclure/facebook-wca-standard-events.html
Sample Facebook Standard Events for New Facebook WCA (Website Custom Audience) Pixel
<!-- Facebook Custom Audience Pixel Code - Placed on Every Page of Site -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','//connect.facebook.net/en_US/fbevents.js');
fbq('init', '{{facebook pixel}}');
fbq('track', 'PageView');
</script>
@ksnider
ksnider / gform_email_fields_notification_admin.php
Created May 25, 2015 17:42
Gravity Forms Email Fields Notification Admin Hook
add_filter(&amp;quot;gform_email_fields_notification_admin&amp;quot;, 'add_field_to_email_list', 10, 2);
// This filter add/remove fields from the list of email fields that get displayed on the Notification edit page when configuring
// the "Send To Field".
add_filter("gform_email_fields_notification_admin", 'add_field_to_email_list', 10, 2);
function add_field_to_email_list($field_list, $form){
//Adds field with ID=1 to the list of email fields
foreach($form["fields"] as $field){
@ksnider
ksnider / order-form-url-params.js
Created April 21, 2015 23:50
Pass URL parameters into Infusionsoft order forms
/*
This script (courtesy of Tyler Garns) passes URL parameters into order forms. The promo code will be
automatically "submitted" Just remove all the other fields that you don't need.
*/
<script>
jQuery(document).ready(function() {
function getUrlVar(key){
var result = new RegExp(key + "=([^&]*)", "i").exec(window.location.search);
if (result != null) {
@ksnider
ksnider / fieldlabels.js
Last active August 29, 2015 14:19
Put labels in fields (updated)
<script type="text/javascript">
$ = jQuery;
$(document).ready(function() {
$.each($('input[type=text]'), function(k, v) {
var input = $('#' + v.id);
var label = $('label[for="' + v.id + '"]').first();
var text = label.html().replace(/ \*/, '') || '';
label.closest('td').remove();
input.attr('placeholder', text).css('width', '100%');
@ksnider
ksnider / image-link-email-builder.html
Created February 24, 2015 21:19
This snippet is the starting point for using an image as a link in Infusionsoft Email Builder
@ksnider
ksnider / email-builder-button.html
Last active August 29, 2015 14:16
This snippet creates a nice red utton you can use as a starting point for building your own buttons
<!-- Modern orange button with square corners and bottom border-->
<div style="width:240px; text-align:center; margin:10px auto; background-color: #FFC53A;
padding-top: 12px; padding-bottom: 12px; padding-right: 15px;
padding-left: 15px; border-top-width: 1px; border-bottom: solid 2px #B26700;
border-radius: 0;">
<div style="text-align: center; font-size:18px; font-family:Helvetica;">
<a href="http://kimsnider.com/learn-infusionsoft-fast/" style="text-decoration:none; color: #321325">
Learn More »
</a>
@ksnider
ksnider / labels-inside-infusionsoft-fields.js
Created February 23, 2015 20:35
This script puts the field labels inside the form fields on an Infusionsoft web form
/*
Instructions:
Paste the code below into an HTML snippet on your webform.
*/
<script type="text/javascript" src="//infusiontraining.s3.amazonaws.com/mastermind/fieldLabels.js"></script>
@ksnider
ksnider / read-only-infusionsoft-field.js
Last active May 19, 2017 07:37
This script will allow you to make a field display on a web form but not be editable by users
/*
Instructions:
In the code below, replace the REPLACE WITH INFUSIONSOFT FIELD NAME with a # and the ID
of the field(s) you want to make read-only.
For example, if you were making the Email field read only, you would replace it with #inf_field_Email and the
code would look like this:
jQuery('#inf_field_Email').attr('readonly', true); // Be sure to leave single quotes in place
@ksnider
ksnider / hide-infusionsoft-field.js
Last active August 29, 2015 14:16
This script will allow you to use a regular field snippet but have it appear hidden on the web form when displayed
/*
Instructions:
In the code below, replace the REPLACE WITH INFUSIONSOFT FIELD NAME with a # and the ID
of the field(s) you want to hide.
For example, if you were hiding the Email field, you would replace it with #inf_field_Email and the
code would look like this:
jQuery('#inf_field_Email').parent().parent().hide(); // Be sure to leave single quotes in place
@ksnider
ksnider / auto-submit-is-form.js
Created January 20, 2015 12:47
This script pulls parameters, if any, from the query string, and automatically submits the Infusionsoft web form
<script>
$ = jQuery;
$(document).ready(function() {
var query, param, arg;
$('html').css('display', 'none');
if (query = window.top.location.href.split('?')[1]) {
$.each(query.split('&'), function (idx, val) {
param = val.split('=')[0];
arg = val.split('=')[1];
if ( ! $('#' + param).length) {