如何管理sitecore中记录的个性化
现在我正在进行sitecore项目,我需要在记录上添加个性化设置,而不是在子布局上。我的项目是基于报告的,我想展示报告,给出以下标准如何管理sitecore中记录的个性化,sitecore,sitecore6,sitecore-dms,personalization,Sitecore,Sitecore6,Sitecore Dms,Personalization,现在我正在进行sitecore项目,我需要在记录上添加个性化设置,而不是在子布局上。我的项目是基于报告的,我想展示报告,给出以下标准 如果是注册用户,则根据客户兴趣显示报告。(客户因注册而增加的客户兴趣。) 如果是匿名用户,报告会根据客户的国家/地区显示(我们如何获得匿名用户的客户国家/地区?) 从Cookie中上次搜索的信息获取报告并显示结果 请帮我解决上述问题。提前感谢。可以通过以下方式实现个性化: 答案2: 使用地理IP查找数据收集您要查找的国家/地区信息。因此,地理IP查找数据通过第三方
请帮我解决上述问题。提前感谢。可以通过以下方式实现个性化: 答案2: 使用地理IP查找数据收集您要查找的国家/地区信息。因此,地理IP查找数据通过第三方web服务提供给Sitecore参与分析。地理IP数据存储在分析数据库中,因此不必对返回的访客执行查找。请记住,默认安装只附带第三方web服务的试用版,因此会产生成本 敬业度分析API主要用于使用
- Sitecore.Analytics.Tracker
- Sitecore.Analytics.TrackerDataContext
public class GeoIPTracker : Sitecore.Web.UI.WebControl
{
protected override void DoRender(System.Web.UI.HtmlTextWriter output)
{
string ip = new IPAddress(Tracker.CurrentVisit.Ip).ToString();
if (Tracker.CurrentVisit == null)
return;
if (!Tracker.CurrentVisit.UpdateGeoIpData())
output.Write("GeoIP information not " + "available within prescribed time.<br/>");
else if (Tracker.CurrentVisit.BusinessName == "IP_NOT_FOUND" || Tracker.CurrentVisit.BusinessName == "N/A")
output.Write("GeoIP information not avaialble for " + ip + ".<br/>");
else if (String.IsNullOrEmpty(Tracker.CurrentVisit.BusinessName))
output.Write("No business name in GeoIP data for " + ip + " (error contacting provider).<br/>");
else
output.Write("Business name from GeoIP record: " + Tracker.CurrentVisit.BusinessName + ".<br/>");
}
}
公共类GeoIPTracker:Sitecore.Web.UI.WebControl
{
受保护的覆盖无效数据源(System.Web.UI.HtmlTextWriter输出)
{
字符串ip=新的ip地址(Tracker.currentVisite.ip).ToString();
如果(Tracker.currentVisite==null)
返回;
如果(!Tracker.currentVisite.UpdateGeoIpData())
输出.写入(“GeoIP信息在规定时间内不可用”+。
);
else if(Tracker.currentVisite.BusinessName==“未找到IP”| | Tracker.currentVisite.BusinessName==“不适用”)
输出.写入(“GeoIP信息不适用于“+ip+”
);
else if(String.IsNullOrEmpty(Tracker.currentVisite.BusinessName))
输出。写入(“GeoIP数据中没有“+ip+”的业务名称”(联系提供商时出错)。
);
其他的
输出.写入(“GeoIP记录中的企业名称:“+Tracker.currentVisite.BusinessName+””
);
}
}
答案1:
您可以使用存储在跟踪字段中的数据,并获取有关注册用户配置文件的特定信息
同样,参与分析API的类如
- Sitecore.Analytics.Data.TrackingField
- Sitecore.Analytics.Data.ContentProfile
- Sitecore.Analytics.Data.ContentProfileKeyData
using System.Linq;
using Sitecore.Analytics.Data;
using Sitecore.Data;
using Sitecore.Data.Fields;
using Sitecore.Data.Items;
using Sitecore.Diagnostics;
public class Profile : Sitecore.Web.UI.WebControl
{
protected override void DoRender(System.Web.UI.HtmlTextWriter output)
{
Item homeItem = Sitecore.Data.Database.GetDatabase("master").GetItem("/sitecore/content/Home");
Field innerField = homeItem.Fields["__Tracking"];
if (innerField == null)
{
Log.Error(string.Format("Tracking field was not found in item '{0}' ('{1}')", homeItem.ID, homeItem.Paths.FullPath), this);
output.WriteLine("No profile values.<br/>");
}
else
{
TrackingField trackingField = new TrackingField(innerField);
ContentProfile profile = trackingField.Profiles.FirstOrDefault(profileData => profileData.Name.Equals("Score") && profileData.IsSavedInField);
output.WriteLine("Profile " + profile.Name + "<br/>");
ContentProfileKeyData[] profileKeys = profile.Keys;
foreach (ContentProfileKeyData profileKey in profileKeys)
{
output.WriteLine("Profile key name " + profileKey.Name + "<br/>");
output.WriteLine("Profile key value " + profileKey.Value + "<br/>");
}
}
}
}
使用System.Linq;
使用Sitecore.Analytics.Data;
使用Sitecore.Data;
使用Sitecore.Data.Fields;
使用Sitecore.Data.Items;
使用Sitecore.Diagnostics;
公共类配置文件:Sitecore.Web.UI.WebControl
{
受保护的覆盖无效数据源(System.Web.UI.HtmlTextWriter输出)
{
Item homeItem=Sitecore.Data.Database.GetDatabase(“主”).GetItem(“/Sitecore/content/Home”);
Field innerField=homeItem.Fields[“_跟踪”];
if(innerField==null)
{
Log.Error(string.Format(“在项目“{0}”(“{1}”)中找不到跟踪字段)、homeItem.ID、homeItem.Paths.FullPath),这是错误的);
output.WriteLine(“无配置文件值,
”);
}
其他的
{
TrackingField TrackingField=新的TrackingField(innerField);
ContentProfile profile=trackingField.Profiles.FirstOrDefault(profileData=>profileData.Name.Equals(“Score”)&&profileData.IsSavedInField);
output.WriteLine(“Profile”+Profile.Name+”
);
ContentProfileKeyData[]profileKeys=profile.Keys;
foreach(ContentProfileKeyData profileKey in profileKeys)
{
output.WriteLine(“Profile key name”+profileKey.name+”
);
output.WriteLine(“Profile key-value”+profileKey.value+”
);
}
}
}
}
让我知道这是否有用
重要信息可在中找到,您使用的是什么Sitecore版本?我可以安全地假设您正在使用DMS吗?我的Sitecore版本6.6。是的,现在我正在做以下两个答案应该让你去。关于你的第三个问题,你能给我更多的信息吗?我认为标记数据可能会派上用场。