Skip to content

Instantly share code, notes, and snippets.

View colinhoward's full-sized avatar

Colin Howard colinhoward

View GitHub Profile
@colinhoward
colinhoward / woocommerce.php
Created March 9, 2015 23:07
WooCommerce <> HasOffers integration
<?php }
add_action( 'woocommerce_thankyou', 'my_custom_tracking' );
function my_custom_tracking( $order_id ) {
$order = new WC_Order( $order_id );
$total = $order->get_order_total();
$id = str_replace('#', '', $order->get_order_number());
@colinhoward
colinhoward / singsignon.json
Created December 19, 2014 18:41
Single sign-on for HasOffers
"data": {
"user_type": "affiliate_user",
"user_id": "2",
"user_status": "active",
"account_status": "active",
"hash": "e864f39cf0521423ce697db1652e216",
"token": "2t434ReL9XHPnQ2eoTLOrBWPvD"
},
@colinhoward
colinhoward / woocommerce.php
Created December 18, 2014 18:52
WooCommerce <> HasOffers Integration
add_action( 'woocommerce_thankyou', 'my_custom_tracking' );
function my_custom_tracking( $order_id ) {
// Pull values from WooCommerce
$order = new WC_Order( $order_id );
$saleAmount = $order->get_total();
/**
<iframe src="https://demo.go2cloud.org/aff_l?offer_id=2&amount=$saleAmount&adv_sub=$order” scrolling="no" frameborder="0" width="1" height="1"></iframe>
@colinhoward
colinhoward / passed_payout.html
Created November 22, 2014 00:08
Pixel with Payout Passed
<iframe src="http://demo.go2cloud.org/aff_l?offer_id=2&amount=AMOUNT&payout=PAYOUT&adv_sub=ORDER _ID" scrolling="no" frameborder="0" width="1" height="1"></iframe>
@colinhoward
colinhoward / calc_payouts.php
Created November 22, 2014 00:06
Calculating Payouts
/Let’s assume this is for an online clothing store and the customer bought shoes, pants, and a shirt. Each category has 5%, 10%, and 15% commission respectively.
$shoes = .05;
$pants = .10;
$shirts = .15;
$aff_payout = ($shoes_price * $shoes) + ($pants_price + $pants) + ($shirts_price * shirts);
//Now that we have calculated and stored the payout that is going to be given to affiliates, we can place that into the &amount= parameter in the pixel and fire it.
@colinhoward
colinhoward / dblclick3.html
Created November 21, 2014 23:59
DoubleClick Ad Tag with HasOffers Link
<script type="text/javascript">
guh=Math.random()*10000000000000000;
document.write('<scr' + 'ipt language=\'JavaScript1.1\' SRC=\"http://ad.doubleclick.net/adj/N8305.134236.VALUECLICK/B7971050.2;sz=120x600;click=http://www.advertiser.com/click.track?CID=260614&AFID=301243&ADID=1085850&NonEncodedURL=http%3A%2F%2Fdemo.go2cloud.org%2Faff_c%3Foffer_id%3D1%26aff_id%3D2%26file_id%3D3516;ord='+guh+'?\"></scr' + 'ipt>');
</script>
@colinhoward
colinhoward / dblclick2.html
Created November 21, 2014 23:58
DoubleClick Ad Tag - Modified
<script type="text/javascript">
guh=Math.random()*10000000000000000;
document.write('<scr' + 'ipt language=\'JavaScript1.1\' SRC=\"http://ad.doubleclick.net/adj/N8305.134236.VALUECLICK/B7971050.2;sz=120x600;click=http://www.advertiser.com/click.track?CID=260614&AFID=301243&ADID=1085850&NonEncodedURL={etracking_link};ord='+guh+'?\"></scr' + 'ipt>');
</script>
@colinhoward
colinhoward / dblclick1.html
Created November 21, 2014 23:57
DoubleClick Ad Tag
<script type="text/javascript">
guh=Math.random()*10000000000000000;
document.write('<scr' + 'ipt language=\'JavaScript1.1\' SRC=\"http://ad.doubleclick.net/adj/N8305.134236.VALUECLICK/B7971050.2;sz=120x600;click=http://www.advertiser.com/click.track?CID=260614&AFID=301243&ADID=1085850;ord='+guh+'?\"></scr' + 'ipt>');
</script>