--- title: "Direct S2S integration" slug: "direct-s2s" updated: 2026-04-08T12:57:55Z published: 2026-04-08T12:57:55Z canonical: "help.awin.com/direct-s2s" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.awin.com/llms.txt > Use this file to discover all available pages before exploring further. # Direct S2S integration Server-to-Server (S2S) allows you to send data directly to Awin’s servers (via an HTTPS request) to circumvent Tracking restrictions placed by a customer’s browser. While you have the option to integrate this via your own custom code as shown below, we *highly recommend* the use of our authenticated [Conversion API](/apis/apidocs/conversion-api) instead. Alternatively, you have the option to integrate this tracking method via [Google Tag Manager](/developers/docs/gtm-s2s). > [!NOTE] > Note > > Server-to-Server calls that occur more than 3 minutes after client-side web requests (e.g., via [Conversion Tag](/developers/docs/conversion-tag) and [Conversion Pixel](/developers/docs/fall-back-conversion-pixel)) are not considered when prioritizing tracking methods. It is important to note that the S2S requests occur near real-time (preferably within the first two minutes to ensure consideration in method prioritization) after the [client-side tracking](/developers/docs/client-side-tracking-1) web requests. ### Request template ```http https://www.awin1.com/sread.php?tt=ss&tv=2&merchant={{advertiserId}}&amount={{totalAmount}}&ch={{channel}}&parts={{commissionGroup}}:{{totalAmount}}&vc={{voucher_code}}&cr={{currencyCode}}&ref={{orderReference}}&testmode={{isTest}}&cks={{awc}} ``` `{{awc}}` must be replaced by the unique Awin Click checksum which may be recorded when the end user lands on the site. For other parameter references, please see the [Fall-back Conversion Pixel](/developers/docs/fall-back-conversion-pixel) reference sheet. ### Capturing the AWC The AWC value is a parameter that is appended to the Landing page URL by Awin to identify the source of a click. You must configure your site to record the AWC’s value when a customer lands on your site. The relevant scripts should run on all pages of your site aside from those where payment or personally identifiable data may be captured or processed. This value will be used to populate the `cks` parameter within the conversion request. If you are using a Cookie to capture the AWC, please respect the following guidelines: - The cookie must be set via an HTTP response header and not in a client-side script. For example, a cookie set in PHP would be fine. - The cookie must be set with the `HTTPOnly` and `Secure` flags. ### Code examples The following examples should serve to provide you with an understanding of methods to accomplish the implementation of this tracking method. Other languages may be available upon request to your integrations point of contact. PHPASP .NETJavaPythonRuby on Rails **Cookie set** On your landing page, this script will set an AWC cookie based on the value found in the page URL. You should replace `example.com` with your website’s URL. ```php ``` **Confirmation page** Once a conversion has occurred, this will send the relevant data to our servers. ```php ``` **Cookie set** On your landing page, this script will set an AWC cookie based on the value found in the page URL. ```csharp private void writeAwcCookie() {    // Check if awc query parameter is present in the url.    if (Request.QueryString["awc"])    {        // Create a cookie.        HttpCookie cookie = new HttpCookie("_awin_awc");        // Set cookie value to the value of awc query parameter.        cookie.Value = Request.QueryString["awc"];        // Set cookie to expire in ...        cookie.Expires = DateTime.Now.AddDays(30d);        // Set httponly        cookie.HttpOnly = true;        // Set secure        cookie.Secure = true;        // Insert the cookie in the current HttpResponse.        Response.Cookies.Add(cookie);    } } ``` **Confirmation page** Once a conversion has occurred, this will send the relevant data to our servers. ```csharp private void awinRequest() {    var awCookie =  Request.Cookies.Get("_awin_awc");    // Check if _awin_awc cookie is present.    //Build the s2s request URL.    //If advertiser uses deduplication (last click), complete request generation must be embedded in If statement, if (awCookie) {var url .... response.Close();}    var url = "https://www.awin1.com/sread.php?tt=ss&tv=2&merchant=ADVERTISER_ID_HERE"  + "&amount=" + {amount} +"&ch=aw" + "&cr=" + {currencyCode} +"&ref=" + {orderId} +"&parts=DEFAULT:" + {amount} + "&vc=" + {voucherCode} +"&cks=" + awCookie;    // Create a request for the URL.    WebRequest request = WebRequest.Create(url);   // Add referer   request.Referer ="https://www.mydomain.com";   // Get the response.    WebResponse response = request.GetResponse();    using (Stream dataStream = response.GetResponseStream())    {        StreamReader reader = new StreamReader(dataStream);        string responseFromServer = reader.ReadToEnd();    }    response.Close();       } ``` **Cookie set** On your landing page, this script will set an AWC cookie based on the value found in the page URL. ```java //get awc and write a cookie on the landing page if (request.getParameter("awc") != null) {    // Create a cookie    Cookie cookie = new Cookie("_awin_awc", request.getParameter("awc"));            // setDomain() method    cookie.setDomain(".yourdomain.com");    // setMaxAge() method    cookie.setMaxAge(60*60*24*365);    // setSecure() method    cookie.setSecure(true);    // setHttPonly() method    cookie.setHttpOnly(true);    // add the cookie to the response    response.addCookie(cookie); } ``` **Confirmation page** Once a conversion has occurred, this will send the relevant data to our servers. ```java //get all cookies Cookie[] cookies = request.getCookies(); String awc = ""; if (cookies != null) {    for (Cookie cookie : cookies) {        if (cookie.getName().equals("_awin_awc")) {            awc = cookie.getValue();        }    } } //build the request url URL obj = new URL("https://www.awin1.com/sread.php?tt=ss&tv=2&merchant=8771&amount=1&ch=aw&cr=EUR&parts=CG:1&ref=11111&vc=&cks=" + awc); //generate request HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestProperty ("Referer", "https://www.mydomain.com"); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); System.out.println("GET Response Code :: " + responseCode); ``` **Cookie set** On your landing page, this script will set an AWC cookie based on the value found in the page URL. ```python from urlparse import urlparse from http import cookies def setcookie(name, value, expiresDays, domain):    morsel = Morsel()    name, value = safestr(name), safestr(value)    morsel.set(name, value, quote(value))    morsel['max-age'] = expiresDays * 86400 #86400 sec is 1 day    morsel['domain'] = "topleveldomain"    morsel['secure'] = True    value = morsel.OutputString()    value += '; httponly'    header('Set-Cookie', value) # get awc and write a cookie on the landing page url = urlparse('requestUrl') for i in url.query.split('&'):    # if awc is present in the url    if "awc" in i:    awc = i.split("=")    # drop a cookie    setcookie("awcCookie", awc[1],30, "topleveldomain")    break ``` **Confirmation page** Once a conversion has occurred, this will send the relevant data to our servers. ```python import urllib2 from os import environ import cgi, cgitb # retrieve cookies and find awc if environ.has_key('HTTP_COOKIE'):    for cookie in map(strip, split(environ['HTTP_COOKIE'], ';')):        (key, value ) = split(cookie, '=');        if key == "awc":            awc = value        else:            awc = ""   # build the request url and generate request request = urllib2.Request("https://www.awin1.com/sread.php?tt=ss&tv=2&merchant="+"{merchantId}"+"&amount="+"{amount}"+"&ch=aw&cr="+"{currency}"+"&parts="+"{commissionBreakdown}"+"&ref="+"{orerReference}"+"&vc="+"{voucherCode}"+"&cks="+awc) request.add_header('Referer', 'https://www.mydomain.com') r = urllib2.urlopen(request) ``` **Cookie set** On your landing page, this script will set an AWC cookie based on the value found in the page URL. ```ruby # check if awc query parameter is present in the url if params[:awc] # create a cookie cookies[:_awin_awc] = {  value: params[:awc],  expires: 1.year.from_now,  domain: 'domain.com',  secure: true,  httponly: true } end ``` **Confirmation page** Once a conversion has occurred, this will send the relevant data to our servers. ```ruby require 'net/https' # Build the s2s request URL url = URI.parse('https://www.awin1.com/sread.php?tt=ss&tv=2&merchant=8771&amount=' + 'totalAmount' + '&ch=aw&cr=EUR&parts=' + 'CommissionGroup' + ':' + 'totalAmount' + '&ref=' + 'orderReference' + '&vc=' + 'voucherCode' + '&cks=' + cookies[:awc]) req = Net::HTTP::Get.new(url.to_s) req['Referer'] = "https://www.mydomain.com"; res = Net::HTTP.start(url.host, url.port, :use_ssl => true) {|http| http.request(req) } ``` ### Product Details (optional) `&bd[0]=` is an array and should be sequential for extra products. e.g. **&bd[0]**, **&bd[1]**, **&bd[2]** Please refer to separate information about the [Product Level Tracking](/developers/docs/product-level-tracking-2#plt-for-conversion-pixel-and-s2s) for additional guidance. ### Custom Parameters (optional) `&p1=examplevalue&p2=examplevalue2` The Fall-back Conversion Pixel is also compatible with our [Custom Parameter](/developers/docs/custom-parameters) scheme (via GET parameter as p1= to p[n]=). The value must be URL-encoded. Example: …&p1=Flight%20%26%20Hotel&p2=%C3%96sterreich… Monitoring user journey from affiliate to advertiser. Page where users land after clicking a link. Small file used to track users between sites.