An object
is defined to make the call to the SAS Real-Time Decision Manager
Web service. This object constructs the necessary request that is
sent to the RTDM Web service. This request contains session information
and then deconstructs the response to update the Web page content.
The following example shows how an object might be defined:
function st_pageCfg()
{
toRTDM = new ST_RTDM(
{
"event_name": "clickstream_fetch_dest",
"url": "http://rtdm.yoursite.com/event",
"target_element_id": "st_rtdm_id", // default
"image_link_element": "CONTENT_CODE", // default
"text_link_element": "CONTENT_TEXT", // default
"href_element": "DEST_URL", // default
"request": [["CUSTOMER_ID", "Float", global_cust_id],
["PRODUCT_ID", "Int", global_product_id]],
"capture": [[“RESPONSE_TRACKING_CODE”,”RTDMRTC],
["TREATMENT_TRACKING_CODE","RTDMTTC"],
[“S1”,”S1”], [“S2”,”S2”],
[“S3”,”S3”], [“S4”,”S4”]] // default
}
);
}
Note: The default
lines did not have to be specified in this example. They are included
for completeness.
When inserted this
code performs the following actions:
-
calls the clickstream_fetch_dest
operation from the Web service located at http://rtdm.yoursite.com/event
-
internally constructs a SOAP request
that contains the CUSTOMER_ID and PRODUCT_ID values. In this example
the global_cust_id and global_product_id are JavaScript variables
that are available from this page
-
receives a response from the Web
service, pulls out the image link information from the CONTENT_CODE
element and the text link information from the CONTENT_TEXT element
-
updates the anchor element in the
current Web page that has the ID value of “st_rtdm_id”
to display the image or text and appends the RTDMRTC, RTDMTTC and
S1 to S4 query parameters to the link
-
records the RESPONSE_TRACKING_CODE
and TREATMENT_TRACKING_CODE S1,S2,S3 and S4 when the image or text
is clicked by the user
The parameters
for the call are explained in the following tables.
The following table
covers the event_name parameter:
event_name
|
|
|
|
|
|
|
|
|
The name of the operation
to be invoked on the Web service
|
|
“event_name”:
“clickstream_fetch_dest”
|
The following table
covers the url parameter:
url
|
|
|
|
|
|
|
|
|
The URL used to locate
the Web service
|
|
“url”:
“http://comany.com/call”
|
The following table
covers the target_element_id parameter:
target_element_id
|
|
|
No (default value searched
for if no value specified)
|
|
|
|
|
|
Specifies the ID attribute
of the anchor element in the Web page that is to be upated as a result
of the values returned from the Web service
|
|
“target_element_id”:
“dynamic_ad”
|
The following table
covers the image_link_element parameter:
image_link_element
|
|
|
No (default value assumed
if none is specified)
|
|
|
|
|
|
Identifies the XML element
in the response from the Web service that contains the text to be
displayed on the current Web page
|
|
“image_link_element”:
“CONTENT_CODE”
|
The following table
covers the text_link_element parameter:
text_link_element
|
|
|
No (default value assumed
if none is specified)
|
|
|
|
|
|
Identifies the XML element
in the response from the Web service that contains the text to be
displayed on the current Web page.
The behavior associated
with this parameter depends on whether the value for the element specified
in the image_link_element is set or blank. If the element that contains
the image_link_element is empty, the text from the text_link_element
is used to create a text advertisement. If the element that contains
the image_link_element has a value, this text_link_element value is
set as the ALT attribute.
|
|
“text_link_element”:
“CONTENT_TEXT”
|
The following table
covers the href_element parameter:
href_element
|
|
|
No (default value assumed
if none is specified)
|
|
|
|
|
|
Identifies the XML element
in the response from the Web service that contains the value to be
used for the HREF attribute on the anchor element. The anchor element
is identified by the target_element_id parameter.
|
|
“href_element”:
“DEST_URL”
|
The following table
covers the Input parameter:
Input
|
|
|
|
|
|
|
|
|
Each element in this
array defines a “Data” element in the generated SOAP
request. Each element in the array should contain three values: the
name of the XML element, its type, and finally its value.
|
|
"input": [["CUSTOMER_ID",
"Float", "12237"],["PRODUCT_ID", "Int", "1050"]]
<Data name="CUSTOMER_ID">
<Float>
<Val>12272</q0:Val>
</Float>
</Data>
<Data name="PRODUCT_ID">
<Int>
<Val>6000</q0:Val>
</Int>
</Data>
|
The following table
covers the capture parameter:
capture
|
|
|
No (default value assumed
if none specified)
|
|
|
|
"capture": [[“RESPONSE_TRACKING_CODE”,”RTDMRTC”],
["TREATMENT_TRACKING_CODE", "RTDMTTC"]]
|
|
Each element in this
array identifies the elements in the response XML whose values should
be collected by the SAS Page Tagging Solution.
Each element contains
two values. The first identifies the response XML element that contains
the value to be collected. The second identifies the query parameter
name to be used to identify this data.
|
|
"capture":[["TREATMENT_CODE","RTDMTC",],
["RESPONSE_TRACKING_CODE","RTDMRTC",],
["TREATMENT_TRACKING_CODE","RTDMTTC"],
[“S1”,”S1”], [“S2”,”S2”],[“S3”,”S3”], [“S4”,”S4”]] Would result in the following parameters being records on the clickstream
collection server: 10.23.14.103 - - [02/Apr/2010:15:13:55 -0400]
"GET /sastag/SASTag.gif?CS=ISO-8859-1$VER=2.11$EVT=
click$CID=ajax$VID=12675421017167022847841310744$URI
=http://yoursites.com/$REF=http://yoursite.com/pages
/page01.html?uname=John &product=bicycle$TTL=http:
//yoursite.com/content/saslogov1.gif$PROT=http$DOM
=yoursite.com$PORT=$PLAT=Win32$SINFO=1280x1024@24$FL
=1$FLV=10.0%20r42$CK=1$JV=1$JVV=1.6.0_18$JS=1$DT
=4/2/2010$TM=15:13:57.700$RTDMTC=WA_Click01$RTDMRTC
=983100010501$RTDMTTC=C80DBDCE9F9D813DE66D43559AD89E00$S1
=12345.0$S2=22345.0$S3=32345.0$S4=42345.0
|