This is an old revision of the document!
Table of Contents
- type:
- integration
- system:
- iDevAffiliate
- name:
- iDevAffiliate Tracking
- description:
- Basic iDevAffiliate tracking for FoxyCart
- tag:
- affiliate, tracking, tutorial
iDevAffiliate Integration
Integrating iDevAffiliate with FoxyCart is simple. Here's a quick rundown:
iDevAffiliate v7.0
Basic setup pretty much identical to v4.x below.
Coupon Code Commissioning
If you'd like to take advantage of the Coupon Code Commissioning feature available with iDevAffiliate, use the following code.
This requires FoxyCart version 1.0+
Place this code before the img code you get from your iDev account as explained later in this page.
{% set active_coupon = "" %}
{% for coupon in coupons %}
{% set active_coupon = coupon.code %}
{% endfor %}
Then append this to the end of the img src value:
&coupon_code={{ active_coupon }}
Which will give you something like this:
{% set active_coupon = "" %}
{% for coupon in coupons %}
{% set active_coupon = coupon.code %}
{% endfor %}
^^receipt_only_begin^^
<img border="0" src="https://www.YOURDOMAIN.com/idevaffiliate/sale.php?idev_saleamt={{ order_total }}&idev_ordernum={{ order_id }}&coupon_code={{ active_coupon }}" width="1" height="1">
^^receipt_only_end^^
Per-Product Commissioning
If you'd like to take advantage of the Per-Product Commissioning feature available with iDevAffiliate, use the following code.
This requires FoxyCart version 1.0+
Place this code before the img code you get from your iDev account as explained later in this page.
{% set products_purchased = "" %}
{% for item in items %}
{% set products_purchased = products_purchased ~ item.code %}
{% if item.item_number != items|length %}
{% set products_purchased = products_purchased ~ "|" %}
{% endif %}
{% endfor %}
Then append this to the end of the img src value:
&products_purchased={{ products_purchased }}
Which will give you something like this:
{% set products_purchased = "" %}
{% for item in items %}
{% set products_purchased = products_purchased ~ item.code %}
{% if item.item_number != items|length %}
{% set products_purchased = products_purchased ~ "|" %}
{% endif %}
{% endfor %}
^^receipt_only_begin^^
<img border="0" src="https://www.YOURDOMAIN.com/idevaffiliate/sale.php?idev_saleamt={{ order_total }}&idev_ordernum={{ order_id }}&products_purchased={{ products_purchased }}" width="1" height="1">
^^receipt_only_end^^
iDevAffiliate v6.0
Pretty much identical to v4.x below.
iDevAffiliate v5.0
Pretty much identical to v4.x below.
iDevAffiliate v4.0
https).
- Check iDevAffiliate's page for instructions.
- Login to your iDevAffiliate manager and click on the Cart Integration link.
- It doesn't matter what you call your variable names. All that matters is that you put in the right placeholders later, so just call your variable names something descriptive like
order_totalandorder_id. - iDev will generate some code that should look something like this:
<img border="0" src="https://www.YOURDOMAIN.com/idevaffiliate/sale.php?idev_saleamt=XXX&idev_ordernum=XXX" width="1" height="1">
- Replace the
XXXwith FoxyCart placeholders like^^order_id^^and^^order_total^^, and surround the code with the receipt only tags to prevent re-triggering the code if you use re-visitable receipts:^^receipt_only_begin^^<img border="0" src="https://www.YOURDOMAIN.com/idevaffiliate/sale.php?idev_saleamt=^^order_total^^&idev_ordernum=^^order_id^^" width="1" height="1">^^receipt_only_end^^ - Create a separate receipt template in your FoxyCart admin. Include your modified code at the bottom of your template.