Adding Experience Optimization to your Java/JSP API (RESTful) Server Role
If your SDL Web implementation uses the new RESTful, service-based setup of Content Delivery introduced in SDL Web 8, your Presentation Server contains the API (RESTful) Server Role. Copy and merge resources for that Server Role.
Procedure
- If you have chosen not to reference the online Content Interaction Libraries (CILs) on Maven from a pom.xml file, then, from your Experience Optimization installation media folder Content Delivery\roles\api\rest\java\lib\, copy all files to the WEB-INF/lib/ subfolder of the Web application that contains your API (RESTful) Server Role.
- If you use Google Analytics, do the following:
- From the installation media folder Content Delivery\roles\api\google-analytics-provider\lib\, copy all files to the WEB-INF/lib/ subfolder of the Web application.
- Copy the P12 key associated with your Google Analytics account to a location on this machine.
- Optionally, if you want to use search terms extracted from the referrer in the search of your Web site, then from the Content Delivery\resources\samples\ installation media folder, copy the file smarttarget.referrers.xml to the WEB-INF\classes\ subfolder of the Web application.
- From the Content Delivery\roles\api\rest\config\ installation media folder, copy the file smarttarget_conf.xml to the WEB-INF\classes\ subfolder of the Web application.
- Go to http://jstl.java.net, the site of the JSTL (Java Standard Tag Library), and download a version of jstl.jar that is compatible with your servlet container version. Copy jstl.jar to your WEB-INF/lib/ subfolder.
- Merge the contents of the file Content Delivery\roles\api\rest\config\logback.xml on the installation media with the existing logback.xml file in the WEB-INF/classes/ subdirectory of your Web application.
- In the WEB-INF/ folder of the Web application, open web.xml for editing and add the following:
<!-- Experience Optimization Experiment Tracking --> <servlet> <servlet-name>Experience Optimization Experiment Tracking</servlet-name> <servlet-class>com.tridion.smarttarget.analytics.tracking.TrackingRedirect</servlet-class> <servlet> <servlet-mapping> <servlet-name>Experience Optimization Experiment Tracking</servlet-name> <url-pattern>/redirect/</url-pattern> <servlet-mapping> - Also add the following to the
jsp-configsection in the same file:<taglib> <taglib-uri>content-tags</taglib-uri> <taglib-location>/WEB-INF/lib/content-tags.tld</taglib-location> </taglib> <taglib> <taglib-uri>smarttarget</taglib-uri> <taglib-location>/WEB-INF/lib/smarttarget.tld</taglib-location> </taglib> - Save and close web.xml
- Restart the Web site.