Target group Name Version Version info Implementation steps Last modified
merchant Drupal Commerce 7 Standard implementation IMPLEMENT DRUPAL COMMERCE TRADETRACKER TRACKING

Latest tested and verified version
Drupal 7.35 Install profile Commerce Kickstart (commerce_kickstart-7.x-2.22)

SETTING UP THE REDIRECT
Seeing as Drupal Commerce uses php you can download the redirect file here download index.php.

After downloading the index.php add your domainName to line 6.

After setting up the redirect for your campaign follow these steps in order to install our conversion registration within your Drupal Commerce environment.

COPY THIS CODE AND FOLLOW THE INSTRUCTIONS
<script type="text/javascript">
var ttConversionOptions = ttConversionOptions || [];
ttConversionOptions.push({
type: 'sales',
campaignID: '[marker]CAMPAIGN_ID[/marker]',
productID: '[marker]PRODUCT_ID[/marker]',
transactionID: '[commerce-order:order-number]',
transactionAmount: '[commerce-order:commerce-order-total:amount_decimal]',
quantity: '1',
descrMerchant: 'Internal orderID [commerce-order:order-id] | [commerce-order:owner]',
descrAffiliate: '',
currency: '[commerce-order:commerce-order-total:currency_code]'
});
</script>
<noscript>
<img src="//ts.tradetracker.net/?cid=[marker]CAMPAIGN_ID[/marker]&amp;pid=[marker]PRODUCT_ID[/marker]&amp;tid=[commerce-order:order-number]&amp;tam=[commerce-order:commerce-order-total:amount_decimal]&amp;data=&amp;qty=1&amp;descrMerchant=Internal orderID [commerce-order:order-id] | [commerce-order:owner]&amp;descrAffiliate=&amp;event=sales&amp;currency=[commerce-order:commerce-order-total:currency_code]" alt="" />
</noscript>
<script type="text/javascript">
(function(ttConversionOptions) {
var campaignID = 'campaignID' in ttConversionOptions ? ttConversionOptions.campaignID : ('length' in ttConversionOptions && ttConversionOptions.length ? ttConversionOptions[0].campaignID : null);
var tt = document.createElement('script'); tt.type = 'text/javascript'; tt.async = true; tt.src = '//tm.tradetracker.net/conversion?s=' + encodeURIComponent(campaignID) + '&t=m';
var s = document.getElementsByTagName('script'); s = s[s.length - 1]; s.parentNode.insertBefore(tt, s);
})(ttConversionOptions);
</script>

NOTE In case your CAMPAIGN ID and PRODUCT ID are not added to this example yet, they should be added manually.

Within the Drupal Commerce administration go to:

Store settings --> Advanced store settings --> Checkout settings --> 'Completion message' checkout pane:



Click the corresponding configure button and in the Checkout completion message input field add the script that is available on this page.

Please note to also select the Full HTML text format or the conversion registration will not work.



After adding the code and selecting Full HTML text format press Save configuration

The campaign is ready to be tested.
Shortlink to this article: https://sc.tradetracker.net/implementation/overview?f[id]=41
14-Mar-2019 15:29:07