Ecshop integrated rebate network CPS interface documentation
1. B2C (merchants) must provide ad link request addresses
1, merchants (B2C) need to provide ad link request address, click the ad to enter the merchant's page, the merchant provides ad link style such as: http://www.dangdang.com/cps/cpsRecord.action
When a user clicks a B2C advertisement on the rebate network, the user jumps to the B2C page and uses the get method to include three parameters: channelid, u_id, and URL.
Ad link example:
Http://www.dangdang.com/cps/cpsRecord.action? Channelid = 51 fanli & u_id = rebate network member number (6 by default) & url = http://www.dangdang.com/index.html
Note:
Link: http://www.dangdang.com/cps/cpsRecord.action
Target link: http://www.dangdang.com/index.html
Parameter description:
Parameter Name Description remarks
Channelid: the unique identification of the merchant's advertisers. This text value can be customized by the merchant (text, fixed value)
U_id: the user ID of the user who returned the EIP.
URL: The target URL of the B2C merchant's link to the merchant's website, which can be any page at the front-end (click this link to jump to the page specified by the merchant, variable)
Note: the format of the preceding three parameters is string type. The three parameters can be customized based on the website requirements of each merchant.
2. When a user clicks an advertisement to link to the B2C page, the value of channelid can be used as a basis for determining the "Order source, b2C obtains the value of the channelid and u_id parameters through the cookie record (the cookie is valid for no less than 30 days). After the user generates the order, b2C needs to save the channelid and u_id of the user to the order database.
Note: If the URL parameter above the ad link is blank, this link will jump to the default landing page (usually B2C homepage) set for the B2C website. If there is a URL parameter, it will jump to this URL.
Ii. Set the advertising effect certification period (RD certification period)
Note:
For the first time, a user jumps to a B2C website through an advertisement link on the rebate network. within a certain period of time (for example, within the cookie validity period), even if the user does not go to the B2C website through the advertisement link on the rebate network, instead, you can directly log on to B2C to place an order. In this case, the result is also a rebate. When this period is exceeded, orders placed directly on the B2C website will not be counted as the performance of the rebate network. This period is called the RD authentication period.
B2C needs to set the effect authentication period (RD authentication period) for the website owner according to the contract content in the program ).
(According to the contract signed by both parties, the RD authentication period is generally 30 days. You can set the client cookie validity period to 30 days)
Iii. Order Data Transmission Mode
1. Send order information
When a user places an order on the B2C website, the system checks the cookie on the order generation page to determine whether the user numbers are from the rebate network and the rebate network. If yes, the system calls the order data sending program, transfer the order information to the order data receiving page specified by the rebate network. (This step must be completed after the order number is generated. It cannot be placed after payment)
Call format: Use get as an example:
Http://data.51fanli.com/union/fanliorder.asp? Otime = 2009-9-1 & o_cd = 10005276 & m_id = m_id & K = 123456 & u_id = 6 & p_cd = 21312 | _ | & c_cd = A | _ | & it_cnt = 1 | _ | & Price = 160 | _ | & comm = 22 | _ |
Place this code segment on the order generation success page. After the order is generated, call this code segment to transfer the order data to the rebate network:
------ M_id B2C domain name. Example: www.baidu.com m_id = Baidu
Note: When an order contains one or more commodities, the p_cd (commodity number), price (commodity unit price), comm (Commission) of the Commodities), c_cd (Category Number of the item owner class), and it_cnt (commodity quantity) each value of these parameters ends with a symbol |_|.
For example, there are two types of products in an order: item 1 and item 2. Their unit prices are unit price 1 and unit price 2 respectively. The classification numbers are Classification 1 and Classification 2, the number is quantity 1 and quantity 2, and the Commission is Commission 1 and Commission 2 respectively. The Commission algorithm is: commodity unit price * Commission Ratio * commodity quantity. In this way, p_cd = item 1 | _ | Item 2 | _ |, price = unit price 1 | _ | unit price 2 | _ |, comm = Commission 1 | _ | Commission 2 | _ |, c_cd = Category 1 | _ | Category 2 | _ |, it_cnt = Quantity 1 | _ | quantity 2 | _ | enter 0 if the parameter is not set.
Description of parameters of real-time order data (the yellow mark must contain data ):
Parameter Name value type description
The specific time of the order under otime date
O_cd string Order No.
M_id string mall code (generally the English name of the website, for example, Baidu)
U_id int user ID (rebate network member ID, AD link input parameter)
P_cd string product number.
It_cnt string commodity quantity
Price string product unit price
C_cd string category No. (interest rate classification)
Comm string Commission (if no value is available)
K string website identification code (fixed value 123456 provided by the rebate Network)
2. Order data query interface
Purpose: return network reads the Order details of the members of the return network on the B2C merchant website through the interface address.
Interface address format, such as: http://www.dangdang.com/queryData.action? Date = maid & unionid = 51 fanli
Date is the query date in the format of yyyy-mm-dd.
This interface outputs order data in text format as follows:
Otime | o_cd | u_id | p_cd | c_cd | it_cnt | price | comm | m_id | _ |... Loop
Note:
A single order contains several items.
This interface data is real-time order data. For data transfer and other reasons, querydata. action can be daily
Query rows to facilitate statistical summary.
3. A record is displayed for multiple or one item in an order.
Example (using ASP code as an example)
Advertiser: eLife
Ad link: http://www.ebuyba.com/jump.asp? Channelid = 51 fanli & u_id = 6 & url = http://www.ebuyba.com
Http://www.ebuyba.com/jump.asp
Jump. ASP page code:
<%
Source = request ("channelid ")
U_id = request ("u_id ")
Url = request ("url ")
Response. Cookies ("Source") = Source
Response. Cookies ("u_id") = u_id
Response. Redirect (URL) 'jump to the specified page
'You can set the cookie validity period according to the contract
%>
--
Add code on the order generation stop page:
1. One order is a product.
<%
If request. Cookies ("Source") = "51fanli" then "determine whether it is from the rebate Network
Otime = now ()
O_cd = Order No. orders placed by members (variable)
M_id = ebuyba 'rebate network allocation (fixed value)
K = 123456 'rebate network allocation (fixed value)
U_id = request. Cookies ("u_id ")
P_cd = 1 & "| _ |"
C_cd = 1 & "| _ |"
It_cnt = 1 & "| _ |"
Price = 10.00 & "| _ |"
'Category 1's rebate ratio is 16%
Comm = 10.00*0.16
Response. Write ("<SCRIPT src = 'HTTP: // data.51fanli.com/union/fanliorder.asp? Otime = "& otime &" & o_cd = "& o_cd &" & m_id = "& server. urlencode (m_id) & "& K =" & 123456 & "& u_id =" & u_id & "& p_cd =" & p_cd & "& c_cd =" & c_cd & "& it_cnt =" & it_cnt & "& Price =" & Price & "& comm =" & comm & "'> </SCRIPT> ")
End if
%>
2. Multiple items in one order
'Order No. o_cd = 564587545
'Category 53's rebate ratio is 10%
'Category 21's rebate ratio is 5%
'Item 1 p_cd = 1 it_cnt = 3 c_cd = 53 price = 20.00 comm = 20.00*0.10 = 2.00
'Item 2 p_cd = 2 it_cnt = 5 c_cd = 21 price = 12.00 comm = 12.00*0.05 = 0.60
<%
If request. Cookies ("Source") = "51fanli" then "determine whether it is from the rebate Network
Otime = now ()
O_cd = Order No. orders placed by members (variable)
M_id = ebuyba 'rebate network allocation (fixed value)
K = 123456 'rebate network allocation (fixed value)
U_id = request. Cookies ("u_id ")
'Item 1 and 2
P_cd = 1 | _ | 2 | _ |
C_cd = 53 | _ | 21 | _ |
It_cnt = 3 | _ | 5 | _ |
Price = 20.00 | _ | 12.00 | _ |
Comm = 2.00 | _ | 0.60 | _ |
Response. Write ("<SCRIPT src = 'HTTP: // data.51fanli.com/union/fanliorder.asp? Otime = "& otime &" & o_cd = "& o_cd &" & m_id = "& server. urlencode (m_id) & "& K =" & 123456 & "& u_id =" & u_id & "& p_cd =" & p_cd & "& c_cd =" & c_cd & "& it_cnt =" & it_cnt & "& Price =" & Price & "& comm =" & comm & "'> </SCRIPT> ")
End if
%>
4 Examples (. NET (C #))
Advertiser: eLife
Ad link: http://www.ebuyba.com/jump.aspx? Channelid = 51 fanli & u_id = 6 & url = http://www.ebuyba.com
Http://www.ebuyba.com/jump.aspxpage code:
<%
String channelid = request. querystring ["channelid"];
String u_id = request. querystring ["u_id"];
String url = request. querystring ["url"];
// Set the cookie validity period based on the contract (generally 30 days)
Response. Cookies ["channelid"]. value = channelid;
Response. Cookies ["channelid"]. expires = datetime. Now. adddays (30 );
Response. Cookies ["u_id"]. value = u_id;
Response. Cookies ["u_id"]. expires = datetime. Now. adddays (30 );
If (url = "" | url = NULL) {url = "/";}
Response. Redirect (URL); // jump to the specified page
%>
After the order is generated, add code on the "Stay" Page:
<%
// Determine whether it is from the rebate Network
If (request. Cookies ["channelid"]. value = "51 fanli ")
{
String otime = datetime. Now. tostring ();;
String o_cd = order number; // The order placed by the member (variable)
String m_id = ebuyba; // rebate network allocation (fixed value)
String K = 123456; // rebate network allocation (fixed value)
String u_id = request. Cookies ["u_id"]. value;
String p_cd = 1 + "| _ | ";
String c_cd = 1 + "| _ | ";
String it_cnt = 1 + "| _ | ";
String price = order amount + "| _ | ";
String comm = price * commission ratio + "| _ | ";
Response. Write ("<SCRIPT src = 'HTTP: // data.51fanli.com/union/fanliorder.asp? Otime = "+ otime +" & o_cd = "+ o_cd +" & m_id = "+ m_id +" & K = "+ K +" & u_id = "+ u_id + "& p_cd = "+ p_cd +" & c_cd = "+ c_cd +" & it_cnt = "+ it_cnt +" & Price = "+ Price +" & comm = "+ comm + "'> </SCRIPT> ");
}
%>
Iv. Test
Party B sends the test link to us and uses the link to place a ticket. Send the order number to check whether the link is consistent