Custom Code

Modified on Sun, 24 Sep 2023 at 04:35 PM

Use custom code to add things like affiliate tracking or google analytics code.

Description

A short description for this custom code. The description will display in the cart admin but will not be visible to your customers.

Code

Code is usually provided to you by your affiliate tracking system or google Use the replacement codes below to insert order values into your tracking code.

CODEDESCRIPTION
[ORDER_NUM]Order Number
[INVNUM]Order Invoice Number
[SUB_TOTAL]Cost of order before discounts and other charges
[SALES_TAX]Sales tax
[SHIPPING_CHARGE]Shipping charge
[SHIPPING_METHOD]Shipping method
[COD_CHARGE]COD charge
[MINIMUM_ORDER_CHARGE]Minimum order charge
[VOLUME_DISCOUNT]Volume discount amount
[PROMO_DISCOUNT]Promotional discount amount
[PROMO_DISCOUNT_CODE]Promotional discount code
[GRAND_TOTAL]Cost of order after discounts and other charges
[B_FNAME]Customer Billing First Name
[B_LNAME]Customer Billing Last Name
[B_ADDR1]Customer Billing Address Line 1
[B_ADDR2]Customer Billing Address Line 2
[B_CITY]Customer Billing City
[B_STATE]Customer Billing State
[B_ZIP]Customer Billing Postal Code
[B_COUNTRY]Customer Billing Country
[B_EMAIL]Customer Billing Email Address
[IP_ADDR]Customer IP Address
[USER1]User defined field 1 value
[USER2]User defined field 2 value
[USER3]User defined field 3 value
[USER4]User defined field 4 value
[USER5]User defined field 5 value
[ITEMS]...[/ITEMS]Items ordered. Replace ... with any of the item codes below.*
[ITEM_NUM]Starting at 1, continuing in sequence for each item.
[ITEM_NAME]Item name
[ITEM_DESC]Item description
[ITEM_UNIT_PRICE]Item price
[ITEM_QTY]Item quantity
[ITEM_TOTAL]Item total (item price * item quantity)
[ITEM_FILE]Item file (digital goods)

* By default, item values are joined by commas. For example, if there were 3 products in an order with item names sku#1, sku#1, sku#3 and your tracking coding contained [ITEMS][ITEM_NAME][/ITEMS], the output would be sku#1,sku#1,sku#3. To change the character that joins item values, use [ITEMS join=:][ITEM_NAME][/ITEMS] (this would produce sku#1:sku#1:sku#3).

Example 1: Your affiliate tracking provider instructed you to add the following HTML code to the last page of the shopping cart,

<img src="https://www.trackitx1.com/x.cgi?amount=amount&invoice=invoice">

In the Tracking Code box you would enter:

<img src="https://www.trackitx1.com/x.cgi?amount=[SUB_TOTAL]&invoice=[INVNUM]">

Example 2: Your traffic analysis provider instructed you to add the following HTML code to the last page of the shopping cart,

<img src="https://www.trackitx1.com/x.cgi?product_id_list=id1,id2,...&invoice=invoice">

In the Tracking Code box you would enter:

<img src="https://www.trackitx1.com/x.cgi?product_id_list=[ITEMS][ITEM_NAME][/ITEMS]&invoice=[INVNUM]">

NOTE: If you use tracking code to track offline orders (mail, telephone or fax), [INVNUM] will display as "N-unpaid", where "N" is a unique number generated by our system. Invoice numbers are not assigned to offline orders.


Will my affiliate tracking system work with the shopping cart?

Yes, as long as the affiliate tracking system requires that you enter HTML or JavaScript code on the "Thank You" page of each completed order.

To set up your affiliate tracking system with your shopping cart, please follow the instructions located in the Order Tracking section.


What else can I track using custom code?

Any solution that requires you to add JavaScript code to pages of the shopping cart can be used as custom code.


Can I track affiliate commissions when a customer pays by mail, fax or telephone?

The option is available in the Order Tracking section. However, your affiliate tracking provider will have to offer a solution for tracking offline payments in order for it to work.

All affiliate tracking systems work differently. Some allow the customer's name or email address to be passed into the affiliate tracking database. This makes it easy to cross-reference order information when a customer pays by mail or fax. Some affiliate tracking systems offer tracking code that causes the affiliate's ID to display directly on order forms, which makes it very easy to know if an affiliate produced an offline order. Our shopping cart is able to manage either method. However, if your affiliate tracking system does not offer either of these solutions, you will only want to track affiliate orders when online payments are made.

Ask your affiliate tracking provider if they offer a solution for tracking affiliate commissions when offline payments are made.


Why are my customers getting a warning message about pages containing nonsecure and secure elements?

Web browser's warn users when an insecure element exists on a secure page. If you added tracking code to secure pages of the shopping cart ("https://" appears in the address bar of your browser), be sure that the tracking code also uses "https://" to track order information.

Ask your affiliate tracking or traffic analysis provider if they offer a secure version of their tracking code.

Why do pages that contain custom code take longer to finish loading?

Custom code causes your customer's browser to pass order data to a server outside of our network. If the server used to collect this data does not respond instantly, the page that contains the custom code will continue to load. If you notice this happening often, report the problem to your affiliate tracking or traffic analysis provider.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article