Adcurve - Boost your profit

Implementation / Tags

This documentation describes how to implement Adcurve on your website.Adcurve has two different tags which are required to make full use of the power and features that Adcurve offers.


Order confirmation page tracking tag

The Order Tag measures all orders and assigns them to the correct channel. It also launches our tag management container, which will launch 3rd party pixels as needed (i.e. only launch channel pixel if the order was assigned to the channel). This tag needs to be implemented on the order confirmation page of your website.

Configuration

The Order Tag needs to be provided with the information about the order. The information which is needed:

  • - Order info; main order information
  • - Item info; information per product bought
  • - User info; information about the customer

Please see below which variables are exactly needed.

How to implement

Add the Order Tag to the order confirmation page of your site, just after the opening < body > tag of the document. Below you find an example of the Order Tag. Please integrate this JavaScript code as shown below. Replace XXX with the appropriate values.

Make sure the shop_code (in the example code on lines 6 and 48) always matches your shop code in AdCurve. Your AdCurve shop code is REPLACE_WITH_SHOPCODE

Do not make any changes to this code or we cannot guarantee our tracking.

Code to use

Paste the code below inside the < body > tag of your order confirmation page.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!-- Start AdCurve Order Tag -->
<script type="text/javascript">
  <!--
    function _s2m_t()
    {
      var s2m_shop = S2MOrderTransaction( REPLACE_WITH_SHOPCODE, "4.1.20160413" );
      var orderInfo = new Object();
      orderInfo.trans_id     = "XXX";
      orderInfo.trans_type   = "XXX";
      orderInfo.amount_1     = "XXX";
      orderInfo.amount_2     = "XXX";
      orderInfo.amount_3     = "XXX";
      orderInfo.coupon_code  = "XXX";
      s2m_shop.set_order_info( orderInfo );
 
      // Repeat itemInfo# where # increases per product
      var itemInfo1 = new Object();
      itemInfo1.trans_id      = "XXX";
      itemInfo1.item_id       = "XXX";
      itemInfo1.item_info_1   = "XXX";
      itemInfo1.item_amount_1 = "XXX";
      itemInfo1.item_amount_2 = "XXX";
      itemInfo1.quantity      = "XXX";
      s2m_shop.add_item_info( itemInfo1 );
 
      var userInfo = new Object();
      userInfo.user_email      = "XXX";
      userInfo.customer_id     = "XXX";
      userInfo.new_customer    = "XXX";
      s2m_shop.set_user_info( userInfo );
      s2m_shop.transact();
    }
    try{
      var __s2m_host = "track.shop2market.com";
      var __s2m_js = document.createElement('script');
      __s2m_js.type = 'text/javascript'; __s2m_js.async = true;
      __s2m_js.src = (("https:" == document.location.protocol) ? "https://" : "http://") + __s2m_host + "/javascripts/s2m.js";
      __s2m_js.onload = _s2m_t;
      __s2m_js.onreadystatechange = function () {
        if (this.readyState == 'complete'|| this.readyState == 'loaded') _s2m_t();
      }
      var __s2m_script = document.getElementsByTagName('script')[0];
      __s2m_script.parentNode.insertBefore( __s2m_js, __s2m_script );
    }catch(err){}
  -->
</script>
<!-- Start AdCurve backup Image tag - Please edit "XXX" to the appropriate data -->
  <img src="https://track.shop2market.com/toi.gif?shop_code=REPLACE_WITH_SHOPCODE&v=4.1.20160413&trans_id=XXX&trans_type=XXX&amount_1=XXX&amount_2=XXX&amount_3=XXX&coupon_code=XXX&oi[][trans_id]=XXX&oi[][item_id]=XXX&oi[][item_info_1]=XXX&oi[][item_amount_1]=XXX&oi[][item_amount_2]=XXX&oi[][quantity]=XXX&ui[user_email]=XXX&ui[customer_id]=XXX&ui[new_customer]=XXX" alt="AdCurve Order Tag " />
<!-- End AdCurve backup Image tag -->
 
<!-- End AdCurve Order Tag --> 

Variables in configuration

Order info variables

Requirement

Description

trans_id

Required Unique ordernumber

trans_type

Required I.e. Order, Lead or Pre-Order

amount_1

Required Total price including tax, excluding shipping costs (two decimals, dot separated). Make sure amount is rounded, so e.g. 19.99

amount_2

Required Total price excluding tax, excluding shipping costs (two decimals, dot separated). Make sure amount is rounded, so e.g. 16.52

amount_3

Required Shipping costs including tax (two decimals, dot separated). Make sure amount is rounded, so e.g. 2.99

coupon_code

Optional Insert used coupon code here

Item info variables (per product)

Requirement

Description

trans_id

Required Unique ordernumber

item_info_id

Required Product ID (must be same as in feed!)

item_info_1

Required Name of the product (escape double quotes)

item_amount_1

Required Product price including tax (two decimals, dot separated). Make sure amount is rounded, so e.g. 8.99

item_amount_2

Required Product price excluding tax (two decimals, dot separated). Make sure amount is rounded, so e.g. 7.43

item_quantity

Required Amount of products bought

User info variables

Requirement

Description

user_email

Required MD5 hash of user e-mail

customer_id

Optional Customer id of signed in users

new_customer

Optional Specify if it's a new customer: 1=new, 0=existing

Example page


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html>
<head>
  <title>Title of order confirmation page</title>
  <meta name="title" content="Your Title" />
  <meta name="description" content="Your Description" />
</head>
<body>
<!-- Start AdCurve Order Tag -->
<script type="text/javascript">
  <!--
    function _s2m_t()
    {
      var s2m_shop = S2MOrderTransaction( REPLACE_WITH_SHOPCODE, "4.1.20160413" );
      var orderInfo = new Object();
      orderInfo.trans_id     = "123456";
      orderInfo.trans_type   = "Order";
      orderInfo.amount_1     = "19.99";
      orderInfo.amount_2     = "16.52";
      orderInfo.amount_3     = "2.99";
      orderInfo.coupon_code  = "";
      s2m_shop.set_order_info( orderInfo );
 
      var itemInfo1 = new Object();
      itemInfo1.trans_id      = "123456";
      itemInfo1.item_id       = "A101";
      itemInfo1.item_info_1   = "Apple";
      itemInfo1.item_amount_1 = "9.99";
      itemInfo1.item_amount_2 = "8.26";
      itemInfo1.quantity      = "1";
      s2m_shop.add_item_info( itemInfo1 );
 
      var itemInfo2 = new Object();
      itemInfo2.trans_id      = "123456";
      itemInfo2.item_id       = "B103";
      itemInfo2.item_info_1   = "Pear";
      itemInfo2.item_amount_1 = "5.00";
      itemInfo2.item_amount_2 = "4.13";
      itemInfo2.quantity      = "2";
      s2m_shop.add_item_info( itemInfo2 );
 
      var userInfo = new Object();
      userInfo.user_email      = "37f0dd3c8f13127554e037a711c5a807";
      userInfo.customer_id     = "user12345";
      userInfo.new_customer    = "1";
      s2m_shop.set_user_info( userInfo );
      s2m_shop.transact();
    }
    try{
      var __s2m_host = "track.shop2market.com";
      var __s2m_js = document.createElement('script');
      __s2m_js.type = 'text/javascript'; __s2m_js.async = true;
      __s2m_js.src = (("https:" == document.location.protocol) ? "https://" : "http://") + __s2m_host + "/javascripts/s2m.js";
      __s2m_js.onload = _s2m_t;
      __s2m_js.onreadystatechange = function () {
        if (this.readyState == 'complete'|| this.readyState == 'loaded') _s2m_t();
      }
      var __s2m_script = document.getElementsByTagName('script')[0];
      __s2m_script.parentNode.insertBefore( __s2m_js, __s2m_script );
    }catch(err){}
  -->
</script>
<!-- Start AdCurve backup Image tag -->
  <img src= REPLACE_WITH_SHOPCODE"https://track.shop2market.com/toi.gif?shop_code=span.attention&v=4.1.20160412&trans_id=123456&trans_type=Order&amount_1=19.99&amount_2=16.52&amount_3=2.99&coupon_code=&oi[][trans_id]=123456&oi[][item_id]=A101&oi[][item_info_1]=Apple&oi[][item_amount_1]=9.99&oi[][item_amount_2]=8.26&oi[][quantity]=1&oi[][trans_id]=123456&oi[][item_id]=B103&oi[][item_info_1]=Pear&oi[][item_amount_1]=5.00&oi[][item_amount_2]=4.13&oi[][quantity]=2&ui[user_email]=987123gherd912gh&ui[customer_id]=123&ui[new_customer]=1" alt="AdCurve Order Tag " />
<!-- End AdCurve backup Image tag -->
 
<!-- End AdCurve Order Tag --> 
 
//rest of your order confirmation page here
 
</body>
</html>