4

We have the following example SmartTarget campaigns set up against dates.

Trigger:

  • "Date is between 01/12/2012 and 31/12/2012"
  • "Date is between 01/01/2013 and 03/02/2013"

I'd like to add an appropriate date selection as a Footprint option in Experience Manager. Following the documentation (requires login), I have the following.

Model

%TRIDION_HOME%\web\WebUI\Models\SiteEdit\Configuration\SiteEditModel.config has:

<footprint ID="date" claimUri="taf:claim:date" ><!-- not sure what claim is needed -->
    <title>
        <value lang="1033">Date</value>
    </title>
    <description>
        <value>Select date.</value>
    </description>
    <settings>
        <isMandatory>true</isMandatory>
    </settings>
    <values>
        <value text="2012-11-01T00:00:00" default="true">
        </value>
    </values>                                           
</footprint>

Editor

%TRIDION_HOME%\web\WebUI\Editors\SiteEdit\Configuration\SiteEditEditor.config has:

<footprint ID="date" controlID="FootprintDate" Icon="calendar"/>

Icons

I also added these icons to:

%TRIDION_HOME%\web\WebUI\Editors\SiteEdit\Themes\Carbon\Images

  • footprint.calendar.16x16.png
  • footprint.calendar.24x24.png
  • footprint.calendar.32x32.png

Question

What's the right claimUri to target the matching SmartTarget campaign dates? The documentation mentions taf:claim:foo but it's not really an example for SmartTarget.

Do I have to restart anything to have the footprint option show?

Update: Clearing browser cache made the option visible. I just need to research the right claim.

  • I definitely want to achieve the same thing. I see in Fredhopper preview that when adding a date claim in adds fh_user_date=20131203 to the url, so the claim could be something like taf:claim:user:date? The Date claim is not declared within the trigger-types.xml configuration file, which makes it harder to find. – Philippe Conil Dec 4 '13 at 0:09
  • In Tridion 2013 you also need enable Claim forwarding for that date claim for XPM to be able to set its value. In cd_ambient_conf.xml <GloballyAcceptedClaims> <Claim Uri="taf:claim:user:date"/> – Philippe Conil Dec 4 '13 at 0:24
6
  1. You need to use fh:user:date as the claim uri.
  2. You also need with Tridion 2013 to enable claim forwarding for that claim. You can do this in the cd_ambient_conf.xml by adding <Claim Uri="fh:user:date"/> within the GloballyAcceptedClaims element.

However, this is not enough, because the date format generated by the FootprintDate control is not recognized by Fredhopper. Here is the result in the FH query: &fh_user_date=2013-12-08T00%3A00%3A00

Using a custom ASP.Net User Control I am able to set this claim and get a promotion triggered correctly. You can actually check the fh_user_date URL parameter value as part of the FH Query in the cd_core_log file, when logging is set in DEBUG mode. A fh query appears as follow in the log:

DEBUG Query - Executing query: fh_location=

So you can either search for "fh_location" or "fh_user_date" directly to find the claim value that you are working with. For instance fh_user_date=20131207 works.

I looked at the Fredhopper Learning Center (login required) and the format of the fh_user_date parameter is simply YYYYMMDD.

To get to the bottom of this, we may need to create a custom Footprint date control which would output that format, or modify the existing FootprintDate control if that is acceptable.

  • Thanks for explaining where to find FH queries. I might have to revisit on a 2013 setup, I don't think the 2011 cd_ambient_conf.xml has a GloballyAcceptedClaims option. A custom control might work for my use case, though maybe just hard-coding the dates would work for this setup (Education demo). I think an Ideas submission (for ways to format that date and/or adding ST claims automatically to the footprint) would be the next step. :-) – Alvin Reyes Dec 4 '13 at 4:18
  • Interesting answer. By default Fredhopper takes the Fredhopper Query server's date for the date triggers. With the fh:user:date we could 'localize' the datetime when having websites in different timezones across the world. – Jan H Dec 4 '13 at 6:49
  • Is your ASP.Net User Control part of XPM as an extension or is it on the Staging site? I searched the 2011 docs for GloballyAcceptedClaims but let me confirm to be sure -- is that only for 2013? What happens for Tridion 2011 (are claims forwarded or "denied" by default? – Alvin Reyes Dec 4 '13 at 23:07
  • There was no claims forwarding in 2011 - but it also wasn't needed. So you don't have to worry about it on your version - you just need the footprint cartridge to be running. – Peter Kjaer Dec 5 '13 at 7:54
1

You could use the fh_user_date as Philippe suggests, or simply your own trigger of type date. I thought fh_user_date was always evaluated based on the current time, but apparently you can override it now. I haven't tried it myself.

Any claims that are defined as triggers in Fredhopper and are of the type Date (in Java) or DateTime (in .NET) will be converted by SmartTarget to the Fredhopper format before being added to the query.

I'm not certain if the date footprint in XPM ends up as a Date object or just a String, but if it's the latter I can see why it wouldn't work. In such a case, I would recommend creating a cartridge which transform the string claim value into a java.utils.Date object. It will then be picked up by SmartTarget and put into the query automatically (provided that you have it set up as a trigger of course).

Of course if the XPM footprint ends up as a Date already, your problem lies elsewhere - most likely in the smarttarget_cartridge not being configured correctly.

Update: I've confirmed that date footprints end up as a string and not a Date object in the claim store.

  • As far as I can see the FootprintDate control creates a string claim. But creating a new cartridge may not help, since the XPM footprint functionality is supposed to overwrite the claim anyway. The initial idea being to be able to preview the website in the future, seeing the promotions valid for a certain date period. There may be other interesting use cases like overwriting the default server date as you guys mentioned. Feel free to expand on the benefits of such an approach. – Philippe Conil Dec 4 '13 at 19:08
  • I'm able to add a java.util.Date.Date to the ClaimStore (and see it with your nifty ADF test page), but I'm not sure on the right order for Cartridges in smarttarget_cartridge. I was going to start another question, but it looks like someone's been here already: tridion.stackexchange.com/a/3117/46. :-) – Alvin Reyes Dec 4 '13 at 23:13
  • @PhilippeConil If you create a new claim you would need to always have your cartridge set the claim (which will then be overwritten by the footprint functionality as needed) – Peter Kjaer Dec 5 '13 at 6:06
  • @PeterKjaer that is correct but do you think a custom trigger of type date can process a date with a format different from YYYYMMDD? – Philippe Conil Dec 5 '13 at 7:49
  • No, but as mentioned you shouldn't have to deal with that detail of Fredhopper. If you just make sure it's a Date object in the Claim Store as opposed to a string, SmartTarget will handle the conversion (also in case the format changes in the future). – Peter Kjaer Dec 5 '13 at 7:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.