Infusionsoft integration
Small business CRM, sales & marketing software.
Infusionsoft is a sales and marketing software built for small business. The integration with it is based on a special code placed to a ‘Thank You‘ page and a built-in plugin.
Built-in Infusionsoft Thank You pages
Login to your Infusionsoft admin panel and open the account you want to integrate (in case you have more of them). Navigate to Ecommerce > Ecommerce setup > Checkout > Order forms and edit every form you want to track sales for. Navigate to the Thank You Page. If you use the built in Thank you page, please place the following code there:
<script type="text/javascript">
document.write(unescape('%3Cscript id=%22pap_x2s6df8d%22 src=%22' + (('https:' == document.location.protocol) ? 'https://' : 'http://') + 'URL_TO_PostAffiliatePro/scripts/jze6hzlz%22 type=%22text/javascript%22%3E%3C/script%3E'));
</script>
<script type="text/javascript">
var customerId = '~Contact.Id~';
var email = '~Contact.Email~';
var callBack = false;
var papAccountId = 'Account_ID';
var infusionAccount = 'XXXXXX';
function getVisitorId() {
return papAccountId + PostAffTracker._cmanager.getVisitorIdOrSaleCookieValue();
}
function visitorCallBack() {
if (callBack == false) {
if ('null' != getVisitorId()) {
callBack = true;
var pixel = document.createElement("img");pixel.width=1;pixel.height=1;
var tempsource = 'https://URL_TO_PostAffiliatePro/plugins/Infusionsoft/infusionsoft.php?visitorId=' + getVisitorId() + '&custId=' + customerId + '&email=' + email + '&sd=' + infusionAccount;
var source = tempsource.replace(/amp;/g,'');
pixel.src = source;
document.body.appendChild(pixel);
}
}
}
try {
PostAffTracker.track();
PostAffTracker.executeOnResponseFinished.push(function() {visitorCallBack();});
}
catch(e){}
</script>
Please note there is a variable ‘infusionAccount‘ with value XXXXXX which you have to set to your Infusionsoft account ID. Usually it is the subdomain of your admin account. Save your work and continue to next step.
Custom Thank You page
In case you use a custom thank you page (Web Address option in Ecommerce > Ecommerce setup > Checkout > Order forms – edit one > Thank You Page) then you should enable the option Pass contact’s information to the Thank You Page.
Remember the thank you page has to be PHP based to make the tracking working.
FYI: You can use the same thank you page for all your forms.
Now, let’s edit your custom Thank You page file – add the following code to the file. Remember the file has to support PHP code!
<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
var customerId = '<?php echo $_GET['contactId']; ?>';
var orderId = '<?php echo $_GET['orderId']; ?>';
var email = '<?php echo urlencode($_GET['inf_field_Email']); ?>';
var callBack = false;
var papAccountId = 'Account_ID';
var infusionAccount = 'XXXXXX';
function getVisitorId() {
return papAccountId + PostAffTracker._cmanager.getVisitorIdOrSaleCookieValue();
}
function visitorCallBack() {
if (callBack == false && "null" != getVisitorId() && (customerId != null || orderId != null)) {
callBack = true;
var pixel = document.createElement("img");pixel.width=1;pixel.height=1;
pixel.src = 'https://URL_TO_PostAffiliatePro/plugins/Infusionsoft/infusionsoft.php?visitorId='
+ getVisitorId() + '&custId=' + customerId + '&orderId=' + orderId + '&email=' + email + '&sd=' + infusionAccount;
document.body.appendChild(pixel);
}
}
try {
PostAffTracker.track();
PostAffTracker.executeOnResponseFinished.push(function() {visitorCallBack();});
}
catch(e){}
</script>
As you can see, the code starts and ends as a JavaScript, so place it out of PHP content. Also note there is a variable ‘infusionAccount‘ with value XXXXXX which you have to set to your Infusionsoft account ID. Usually it is the subdomain of your admin account.
Enable Infusionsoft plugin
The final step is to enable the Infusionsoft plugin in your Post Affiliate Pro. When active, you have to configure the plugin – it will ask you for API Key and for your account name.
The API key can be found in your Infusionsoft > Admin > Settings > Application > Encrypted Key. Just copy the value and paste it to the plugin.
The account name is your Infusionsoft account name, found in Your Accounts section right after you login to your Infusionsoft. The account name is also used in all your Infusionsoft links as a subdomain, e.g. your product links.
That’s it. Save your settings and you are done with the integration.
Recurring payments
If you want to track recurring payments as well, you can achieve that with Billing Automation in Infusionsoft and Lifetime Commissions plugin in Post Affiliate Pro.
The first step would be to navigate to Infusionsoft > E-Commerce > Settings > Billing Automation and create a new rule, to call a URL for every completed order:
Save it and now enable Lifetime Commission plugin in your Post Affiliate Pro. That’s it. Recurring commission will now be tracked as well.
Do not forget to integrated your landing pages with the click tracking code to make it all working.
Instatus Affiliate Department Contact
Learn more about Instatus here. Visit the affiliate manager directory to get contact information, geographic focus, experience details and more.