If you are looking to add tracking code to every page of your cart (for example, Google Analytics javascript to be shown on every page to track your traffic funnel) then you do not want to use the conversion tracking integration! You want to use the Tracking HTML field under Settings > Store Setup.
The DPD Universal 3rd Party HTML / JavaScript Conversion Tracking Code integration (or DPDU3PHTMLJSCTCI for short... ha! just kidding!) places code on the delivery page of an order. The delivery page is the "confirmation page" for every DPD order no matter what type of product it contains. There are available merge variables so that you can include order data in to the code for use by 3rd party systems.
Activating the Integration
Note; This integration is only available for the new cart and checkout system. If you are using an older version and don't have this integration available in the list please follow the upgrade cart link in the left menu. It's free to upgrade to the current version!
1. Log in to DPD
2. If you have multiple stores, select the store you want to add the integration to using the store selector in the top right corner of the dashboard
3. Go to Integrations in the left menu under Settings to open the integration list
4. Find the More Tracking Integrations in the list and click "3rd Party Conversion," It will look like the screenshot below:
5. Once you click add the configuration page will open up with 3 options:
a) Enable should be checked
b) Name: Name the integration whatever you want. We recommend naming it for the service you are integrating. This will help if you enable multiple versions of the 3rd party tracking code later.
c) The code snippet to be displayed
6. Complete the 3 fields with your info and save.
You're done!
Including Variables in the Code Snippet
DPD makes a number of variables from our template system available for use in the code snippet. These variable names will be replaced with their values for actual orders.
Order - Order variables are related to the customers order. For example:
{{order.id}}
{{order.total_price}}
{{order.subtotal_price}}
{{order.tax_price}}
{{order.shipping_price}}
{{order.total_discount}}
To get the coupon used in an order:
{% if order.coupons[0] %} {{ order.coupons[0].code }} {% endif %}
Store - Variables related to the store. For example:
store.name
store.contact_email
Customer - Variables related to the customer for this order. For example:
{{customer.first_name}}
{{customer.last_name}}
{{customer.email}}
Advanced Variable Usage
You can use twig math expressions on the available variables to get complex results. For example, if you wanted to use the order total less tax in your integration code (for if you want to pay affiliates for the subtotal less discounts but not for tax and shipping costs) you would do this:
{{ order.total_price - order.tax_price }}
* (multiply), / (divide), + (add), and - (subtract) are available and follow the standard order of operations when they are evaluated.
An Example Snippet Using Variables
This snippet is from the Post Affiliate Pro system as an example: