WS-Tracking (EN)
What is tracking or analytics data?
WEBSALE transmits certain shop data to external systems in real time for further processing. This data is the basis for all shop-specific statistical evaluations.
No personal data is transmitted, but only general data such as
displayed page (name of the page)
displayed category (category name)
displayed article (article name and article number)
Ordered article (article name, article number, quantity and price)
Zip code, city and country of billing and delivery address
Payment method and delivery
etc.
Data interface
WEBSALE passes the data in JavaScript variables, which in turn can be read and processed by JavaScript. The JavaScript that processes the transferred variables is usually created by the external service provider.
On each page generated by WEBSALE, the shop system sets the corresponding JavaScript variables.
The general structure is as follows:
<html>
<head>
...
</head>
<body>
...
...
<script language="JavaScript">
<!--
var ws_state="Start";
var ws_page_name="Home";
var ...
...
//-->
</script>
<script src="<JavaScript file>" type="text/javascript"></script>
</body>
</html>
At the end of the HTML page, the corresponding code parts of WEBSALE are inserted. First, the JavaScript variables are set there by WEBSALE. Then a JavaScript file is called, which reads the values set by WEBSALE, processes them and sends them to the external system.
The JavaScript is usually created by the external service provider.
Description of the variables
On each page the variable "ws_state" is set, which indicates the status or state. Depending on this variable, other variables follow.
Net/gross prices
In a net shop, all prices or costs (except ws_basket_total) are displayed in net (excluding VAT). In a gross shop, all prices or costs are output in gross (including VAT).
Some costs (value of goods, grand total, etc.) are output in net and gross.
Standard variables
Standard variables are output on every page and can be empty.
Variable | Meaning |
---|---|
ws_state | Status or state the shop is in when the page is displayed. |
ws_shopid | The shopID is assigned by WEBSALE and exists for each WEBSALE shop. |
ws_subshopid | The SubshopID is assigned by WEBSALE and exists for each WEBSALE shop. Subshops are used e.g. for additional shop languages, but can also represent an end customer shop (B2C) or a dealer shop (B2B). |
ws_sid | Session ID of the shop This 32-character ID is generated uniquely for each shop visit. It can be used to measure the exact number of visits. |
ws_extid | This optional ID is assigned by an external service provider. |
ws_page_name | Name of the displayed shop page, e.g. "shopping cart". |
ws_data_type | Possible values: |
ws_order | Possible values: |
ws_referer | Will be passed optionally when calling the shop z. E.g. "...&ref=google" |
ws_subreferer | Additional information about the referer Is optionally transferred with the call of the shop z. E.g. "...&subref=banner26" |
ws_http_referer | HTTP referer. Complete URL from which the shop was called Please note: |
ws_login_type | Current state of the login/registration Possible values: |
ws_tp1 | An optional parameter (maximum 128 characters), which can be passed additionally when calling the shop (with "&ws_tp1=..."). |
ws_tp2 | Meaning and handling as for "ws_tp1". |
ws_tp3 | Meaning and handling as for "ws_tp1". |
ws_gclid | Optional GoogleClickID (max. 64 characters), which can be passed additionally when calling the shop (with "&gclid=..."). |
ws_test | Possible values: |
ws_userindex_md5 | MD5 hash (16 bytes, 32 characters) of the user index. The UserIndex is a unique ID when a user logs in or registers in the shop. This ID is assigned only once and remains constant for a user over the entire period. For non-registered users this parameter is empty. |
ws_email_md5 | MD5 hash (16 bytes, 32 characters) of the email address. This value will be output only if the shop knows the e-mail address of the orderer. |
ws_price_type | Values: |
ws_currency | Currency code according to ISO 4217, e.g. "EUR" for Euro |
ws_currency_display | Optional target currency according to ISO 4217, if several subshops work with different currencies |
ws_exchange_rate | Optional exchange rate, related to the target currency. Example: |
Table of possible states
State "ws_state | Description | additional variables |
---|---|---|
Start | Start page |
|
Category | Display a category | ws_cat_name (name of the category) |
Product | Display of an article | ws_cat_name |
Basket | Display the basket |
|
AddBasket | One or more items were added to the basket | ws_add_basket_positions (Number of added items) ws_add_basket_mainpositions (Number of added main items in the basket, considers all items except hidden items and set subproducts) ws_add_basket_quantities (number of added items) ws_add_basket_mainquantities (number of added main items in the basket, considers all items except hidden items and set subproducts) The following information will be output when ws_data_type=advanced! ws_add_basket_subtotal (value of added items) ws_add_basket[i][1] (Item number) ws_add_basket[i][2] (item name) ws_add_basket[i][3] (Price) ws_add_basket[i][4] (Quantity) ws_add_basket[i][5] (Category path) ws_add_basket[i][6] (Product index) ws_add_basket[i][7] (VAT rate, e.g. "19") ws_add_basket[i][8] (Total amount) ws_add_basket[i][9] (Set top product yes/no) ws_add_basket[i][10] (Set subproduct yes/no) ws_add_basket[i][11] (hidden position yes/no) i=1 ... n n= number of items in basket |
DelBasket | One or more items were deleted from the basket | ws_del_basket_positions (Number of deleted positions) ws_del_basket_mainpositions (Number of deleted main items in the basket, considers all items except hidden items and set subproducts) ws_del_basket_quantities (Number of deleted quantity) ws_del_basket_mainquantities (number of deleted main items in the basket, considers all items except hidden items and set subproducts) The following information will be output when ws_data_type=advanced! ws_del_basket_subtotal (value of goods of deleted items) ws_del_basket[i][1] (Article number) ws_del_basket[i][2] (item name) ws_del_basket[i][3] (Price) ws_del_basket[i][4] (Quantity) ws_del_basket[i][5] (Category path) ws_del_basket[i][6] (Product index) ws_del_basket[i][7] (VAT rate, e.g. "19") ws_del_basket[i][8] (Total amount) ws_del_basket[i][9] (Set top product yes/no) ws_del_basket[i][10] (Set subproduct yes/no) ws_del_basket[i][11] (hidden position yes/no) i=1 ... n n= number of items in basket |
Address | Input of the billing address |
|
DelivAddress | Input of a different delivery address |
|
PayDeliv | Specification of the payment method and delivery |
|
Conditions | Display of the terms and conditions page |
|
PlaceOrder | Order overview, send order |
|
Confirm | Confirmation page | The following information will be displayed if ws_data_type=advanced! ws_order_number (Unique order number) ws_basket_positions (Number of positions in the basket) ws_basket_mainpositions (Number of main items in the basket, considers all items except hidden items and set subproducts) ws_basket_quantities (Number of items in the basket) ws_basket_mainquantities (Number of main items in basket, considers all items except hidden items and set subproducts) ws_basket_subtotal (value of goods, gross or net) ws_basket_subtotal_net (value of goods, net) ws_basket_subtotal_gross (Gross value of goods) ws_basket_total (total, always gross) ws_basket_total_net (total net) ws_affiliate_provider (Name of the affiliate provider) ws_affiliate_partner_id (Affiliate partner ID) ws_delivery_name (Delivery name) ws_delivery_cost (Delivery cost) ws_payment_name (Payment method name) ws_payment_cost (Cost of payment method) ws_total_discount (total discount given) ws_a_zip (postal code of the billing address) ws_a_city (city of the billing address) ws_a_country (country of the billing address) ws_a_number (MD5 hash of the customer number) ws_d_zip (Postal code of the dev. delivery address) ws_d_city (City of the different delivery address) ws_d_country (Country of the different delivery address) ws_basket[i][1] (Item number) ws_basket[i][2] (item name) ws_basket[i][3] (Price) ws_basket[i][4] (Quantity) ws_basket[i][5] (Category path) ws_basket[i][6] (product index) ws_basket[i][7] (VAT rate, e.g. "19") ws_basket[i][8] (Total amount) ws_basket[i][9] (Set top product yes/no) ws_basket[i][10] (Set subproduct yes/no) ws_basket[i][11] (hidden position yes/no) ws_basket[i][12] (commission info) ws_basket[i][13] (AdditionalInput fields) {
"additionalinput1" : "value1",
"additionalinput2" : "value2"
...
} ws_basket[i][14] (ExtraInput fields) {
"extrainput1" : "value1",
"extrainput2" : "value2"
...
} ws_basket[i][15] (free fields in basket) {
"style" : "value1",
"material" : "value2"
...
} ws_basket[i][16] (number of used addresses of the item (if MultiALA)/empty, if MultiALAs not used) i=1 ... n Optional costs for climate-neutral production Optional costs for Web2Print |
ProductRecmd | Recommend article | ws_cat_name |
ProductRecmdConfirm | Recommend article confirmation | ws_cat_name |
Voucher | Page Enter voucher number |
|
Notify | General notification page | ws_notify_msg (text of the notification) |
OrderHistory | Page shopping cart history (order history) |
|
Search | Search results | ws_search_phrase (search phrase) ws_search_results (number of hits of the search) |
MemoList | Show memo list |
|
PrintConfirm | Print view of the confirmation page |
|
Login | Login or registration in the shop | ws_login_error (Error during login/registration) na: Login page was called error: General error uid_pw: Invalid user ID or password for existing customer login new_uid: UserID already exists at registration or is wrong at new customer registration new_pw: Wrong password at a new customer registration change_uid: UserID already exists or is wrong at "Change UserID change_pw: Password is wrong at "Change password |
UserAccount | Customer account |
|
Template | Any template | ws_template_name |
DirectOrder | Direct order |
|
Logout | Logout |
|
Notes about the parameters:
ws_affiliate_provider
Name of the affiliate provider. Currently WEBSALE supports the following operators:
Adbutler
Affilinet
Awin (formerly Zanox)
TradeDoubler
Please note:
The parameter is only set if the corresponding affiliate operator has been activated for your shop. Please contact WEBSALE AG for this.
ws_affiliate_partner_id
The PartnerID, which was used to access the shop. The commission is paid to this affiliate ID.
WEBSALE keeps the affiliate ID in a cookie for 4 weeks for possible follow-up orders.
The parameter "ws_affiliate_partner_id" corresponds to the following transfer parameter of the operator:
Operator | transfer parameter of the operator |
---|---|
Adbutler | fp |
Affilinet | ref |
Awin (formerly Zanox) | PartnerID |
TradeDoubler | tduid |
Please note:
The parameter is only set if the corresponding affiliate operator has been activated for your shop. Please contact WEBSALE AG for this.
Product index
The product index is a variant-independent, unique index per article. An article number, on the other hand, can change per variant.
Example: Pants with variants
Color | Size | Item number | Product index |
---|---|---|---|
red | 42 | 12345-1 | 24-2333 |
red | 43 | 12345-2 | 24-2333 |
blue | 42 | 12345-3 | 24-2333 |
Examples
Default parameters on all pages
var ws_shopid="test";
var ws_subshopid="german";
var ws_sid="01b0e4e61dd4910fe09d79f07427e4";
var ws_extid="0815";
var ws_data_type="advanced";
var ws_order="no";
var ws_referer="xyz";
var ws_subreferer="123";
var ws_http_referer="http://www.domain.de/seite.htm";
var ws_login_type="na";
var ws_tp1="12345";
var ws_tp2=""
var ws_tp3=""
var ws_gclid="";
var ws_userindex_md5="";
...
Calling the start page
<script language="JavaScript">
<!--
<default parameters (see above)>
var ws_state="start";
var ws_page_name="Home";
//-->
</script>
Displaying a category
<script language="JavaScript">
<!--
<default parameter (see above)>
var ws_state="Category";
var ws_page_name="Category";
var ws_cat_name="clothes/pants/jeans";
//-->
</script>
The full path separated by "/" is always displayed as the category name.
Display of an article
<script language="JavaScript">
<!--
<default parameter (see above)>
var ws_state="Product";
var ws_cat_name="Technology/Handys";
var ws_prod_name="Nokia 6100";
var ws_prod_number="123456";
//-->
</script>
Add an item with quantity 3 to the shopping cart ws_data_type=advanced
<script language="JavaScript">
<!--
<default parameter (see above)>
var ws_state="AddBasket";
var ws_page_name="Basket: add item";
var ws_add_basket_positions="1";
var ws_add_basket_quantities="3";
var ws_add_basket_subtotal="30.00";
var ws_add_basket = new Array();
ws_add_basket[1] = new Array();
ws_add_basket[1][1] = "12345";
ws_add_basket[1][2] = "123 pants";
ws_add_basket[1][3] = "10.00";
ws_add_basket[1][4] = "3";
ws_add_basket[1][5] = "clothes/pants";
...
//-->
</script>
Delete an item with quantity 1 from the shopping cart ws_data_type=advanced
<script language="JavaScript">
<!--
<default parameter (see above)>
var ws_state="DelBasket";
var ws_page_name="Shopping basket: delete item";
var ws_del_basket_positions="1";
var ws_del_basket_quantities="1";
var ws_del_basket_subtotal="128.40";
var ws_del_basket = new Array();
ws_del_basket[1] = new Array();
ws_del_basket[1][1] = "112233";
ws_del_basket[1][2] = "shoes";
ws_del_basket[1][3] = "128.40";
ws_del_basket[1][4] = "1";
ws_del_basket[1][5] = "clothes/shoes";
...
//-->
</script>
Calling the login page
<script language="JavaScript">
<!--
<default parameters (see above)>
var ws_state="login";
var ws_login_type="input";
var ws_login_error="na";
//-->
</script>
Incorrect login of a legacy customer, UserID or password incorrect
<script language="JavaScript">
<!--
<default parameter (see above)>
var ws_state="Login";
var ws_login_type="input";
var ws_login_error="uid_err";
//-->
</script>
Incorrect registration of a new customer, UserID already exists
<script language="JavaScript">
<!--
<default parameter (see above)>
var ws_state="login";
var ws_login_type="register";
var ws_login_error="new_uid";
//-->
</script>
Order confirmation with 1 item without different shipping address and without customer number ws_data_type=advanced
<script language="JavaScript">
<!--
<default parameter (see above)>
var ws_state="Confirm";
var ws_page_name="Order_confirmation";
var ws_order_number="1234567890";
var ws_payment_name="Invoice";
var ws_payment_cost="0.00";
var ws_delivery_name="DHL";
var ws_delivery_cost="5.50";
var ws_basket_positions="1";
var ws_basket_quantities="1";
var ws_basket_subtotal="123.00";
var ws_basket_total="128.00";
var ws_a_zip="90453"
var ws_a_city="Nuremberg"
var ws_a_Country="Germany"
var ws_a_number=""
var ws_basket = new Array();
ws_basket[1] = new Array();
ws_basket[1][1] = "12345";
ws_basket[1][2] = "123 pants";
ws_basket[1][3] = "123.00";
ws_basket[1][4] = "1";
ws_basket[1][5] = "clothes/pants";
...
//-->
</script>
Order confirmation with 2 items with different shipping address and with customer number ws_data_type=advanced
<script language="JavaScript">
<!--
<default parameter (see above)>
var ws_state="Confirm";
var ws_page_name="Order_confirmation";
var ws_payment_name="Cash on delivery";
var ws_payment_cost="4.50";
var ws_delivery_name="UPS Standard Package";
var ws_delivery_cost="7.50";
var ws_order_number="1234567890";
var ws_currency="EUR";
var ws_basket_positions="2";
var ws_basket_quantities="3";
var ws_basket_subtotal="200.00";
var ws_basket_total="205.00";
var ws_a_zip="90453"
var ws_a_city="Nuremberg"
var ws_a_Country="Germany"
var ws_a_number="0033211ddddff34553432344448033221"
var ws_d_zip="12345"
var ws_d_city="Example city"
var ws_d_Country="Germany"
var ws_basket = new Array();
ws_basket[1] = new Array();
ws_basket[1][1] = "12345";
ws_basket[1][2] = "123 pants";
ws_basket[1][3] = "100.00";
ws_basket[1][4] = "2";
ws_basket[1][5] = "clothes/pants";
...
ws_basket[2] = new Array();
ws_basket[2][1] = "11111";
ws_basket[2][2] = "pants xyz";
ws_basket[2][3] = "100.00";
ws_basket[2[4] = "1";
ws_basket[1][5] = "clothes/pants";
...
//-->
</script>
The customer number is 32 characters long and is formed from a 16Byte MD5 hash.
Order confirmation with ws_data_type=basic
<script language="JavaScript">
<!--
<default parameter (see above)>
var ws_state="Confirm";
var ws_page_name="Order_confirmation";
//-->
</script>
Displaying the search results
<script language="JavaScript">
<!--
<default parameter (see above)>
var ws_state="Search";
var ws_page_name="search_results";
var ws_search_phrase="shoes leather black";
var ws_search_results="85";
//-->
</script>
Related content
© 2025 WEBSALE AG | Impressum | Datenschutz