Quantcast
Channel: Ryan Bailey Development
Viewing all 287 articles
Browse latest View live

Login, logout and registering accounts in Sitecore

$
0
0
The security model in Sitecore is abstracted from the default .NET providers of membership, profiles and roles. This means that it's actually possible to achieve the same functionality (login for example) using the default .NET methods rather than one from the Sitecore API.

A user in Sitecore will always follow the domain\username format, and all references to a username, need to include the relevant domain. That user will come out of the box with a default profile which includes such information as full name or email address, however it is possible to extent the profile with custom properties (using Sitecore's template system).

User registration

To register a user in Sitecore we simply need a name, email, password and username. In the code sample below, the extranet domain is used and the username is the email address (as this is a unique field for public users in this case). 

This is only a basic implementation, you will also need to include handling of users who attempt to register an email address which is already registered, or perhaps don't meet any password requirements.

User login

Logging in with Sitecore is as simple as collecting a username and password and calling a function.

You can also detect if a user is logged in by using the following code:
if (Sitecore.Context.User.IsAuthenticated) 
But note that this will detect users logged into the Sitecore CMS along with any users whom use your custom forms.

User logout

Logging out is simply calling the following line of code:
FormsAuthentication.SignOut();

Custom properties on a user

It is also possible to have custom properties on a user profile which you can then set the values of in code. For more information see Sitecore custom properties on a user profile.

Sitecore custom properties on a user profile

$
0
0
In Sitecore, by default there are a number of fields which are set on a user profile. These include such details as: full name, email address, password, comment, etc. It can be a requirement with a specific Sitecore implementation to store a number of custom fields against each user profile, perhaps mailing address details for example.

Instead of using custom SQL databases or Sitecore items, you can actually create a Sitecore template and have that appear on the user profile (as custom properties). To achieve this, you will need to complete the following steps:


Creating the custom profile

  1. From the Sitecore desktop, switch to the Core database

  2. Open the content editor and navigate to /sitecore/templates/System/Security, and insert a new template, in this case I have called it CustomProfile.
  3. As with any Sitecore template, create the desired fields you wish stored against each profile.

  4. Whilst still using the Core database, navigate to /sitecore/system/Settings/Security/Profiles and insert your CustomProfile template under the existing User item.

  5. Take note of the ID of the CustomProfile item, and then switch your database back to Master.

Adding the custom profile to a user and editing the fields

To assign this custom profile to a user you simply need the ID of the profile, and will assign the profile programatically.

You can then see the custom profile has been added to the user, by viewing it in the User Manager from the Sitecore desktop.

The custom profile properties can be set there, or done so via code:

Schedule code to run using Agents in Sitecore

$
0
0
In Sitecore the concept of an agent is simply a scheduled task that is managed by Sitecore, which will call a given method on a class. By default Sitecore will already have several agents defined in the web.config file, one example is an agent scheduled every 4 hours to clean up the publishing queue.

A specific example where I have used agents, was to schedule a custom class which synced data into Sitecore from a third party system.


Defining the Sitecore Agent

In your web.config file, locate the /configuration/sitecore/scheduling/ section, here you will notice several agent items. Insert a new agent into this section as follows:
<agent type="MyProject.Jobs.DataSync" method="DoSync" interval="06:00:00" />
In this example, the DoSync method of the MyProject.Jobs.DataSync class will run every 6 hours.

Defining the class

The example class for the above agent would look like follows:


Using parameters

It's also possible to pass parameters into the class you are calling, this would be done using the following example.
<agent type="MyProject.Jobs.DataSync" method="DoSync" interval="06:00:00">
  <param>Test Value</param>
</agent>

Granting access to uCommerce to users in Sitecore

$
0
0
In a default installation, only administrators will have access to uCommerce in Sitecore. There is some setup that will need to be completed to give relevant users access to use/administer the system. This will be achieved by using custom sitecore group(s), and as with any group you can be granular with the access rights (for example one group may only be able to edit products whilst another has full access to purchase orders etc.).

In this example, one group will have access to all features of uCommerce.

Initial steps

  1. First you will need to create a Sitecore group, this can be done via the role manager. I have callued my group uCommerce on the Sitecore domain. 


  2. Now we need to give the group read access on the uCommerce application shortcuts (the one on the launchpad, content editor and desktop).
    1. Load up the Sitecore desktop and set the context to the core database.


    2. Go to the content editor,
      1. There are three items that the uCommerce group will need read access to: "/sitecore/content/Documents and settings/All users/Start menu/Left/uCommerce","/sitecore/client/Applications/Launchpad/PageSettings/Buttons/ContentEditing/uCommerce", and "/sitecore/content/Applications/uCommerce"
      2. This can be done via Assign on the security ribbon


Now that the group is created and has permission to see the uCommerce application, we can use the uCommerce settings to control access at a feature level.

Assigning uCommerce permissions

  1. As a Sitecore admin, load up the uCommerce application
  2. Under Settings> Security> Groups, select the group you wish to grant access to (in this case sitecore\uCommerce)
  3. From the right hand side, select the uCommerce functions you want the users to be able to perform


Now any user that is a member of the group will have access to load the uCommerce application and perform the desired functions. In a real world scenario you would have different groups for different functions (simple product editors vs those with access to purchase orders).

Working with the uCommerce API in Sitecore

$
0
0
uCommerce is a very powerful e-commerce module available for both Sitecore and Umbraco. The API that comes out of the box is equally powerful and have methods which make it possible to import a full product catalog from the third party system. This post will provide example calls into the uCommerce API, which should be everything needed to import data for a full catalog. Many of the methods assume one product catalog (which is a static variable).


Catalog

Each uCommerce shop can have a number of catalogs. The code example below allows you to get a catalog by it's name.


Categories

Below are the methods to get all/single categories, to create a category and to hide a category (set it to not display on web).


Products & Variants

Below are a number of helper methods which include: setting custom properties on products, hiding products, getting product form category and getting a variant from it's parent product.

Then are the actual methods for creating products and variants.

It's worthwhile adding some error handling around this API, especially if the process is done via an automatic sync.

Syncing uCommerce data between Sitecore environments using Visual Studio

$
0
0
Because uCommerce data is actually stored directly in the database, syncing that shop data (products and even orders) is not as simple as using a Sitecore package or Team Development for Sitecore. The best method is to sync the actual database tables, of which there a number of tools available both paid and free.

I have found success using SQL Server Data Tools in Visual Studio. A download is available online, however there may be licensing considerations based on which version of visual studio you are using.
Once installed, the following steps can be followed to sync data from one uCommerce environment to another.

  1. In visual studio, open the SQL Server Object Explorer (from the View menu)
  2. Add the connection details for both SQL environments. You will simply need the server name and authentication details.
  3. Right click the web database (Sitecore) of the source Sitecore installation and select Data Comparison


  4. Now select the target database (which is the Sitecore Web database, where you want the data to be synced to).


  5. Now you will select the data which is to be compared, if you are looking to sync everything, simply select everything that begins with [dbo].[uCommerce*]


  6. Click finish and the comparison will be made. The summary shows all of the differences between the source and target and clicking Update Target will move all uCommerce data over.

  7.  
Please note: this method works well when populating from a production environment to test/dev for development purposes. When syncing between actual live environment, or where a merge happens, care should be taken is terms of what data is removed or even deleted.

Code first Entity Framework composite key which contains a foreign key

$
0
0
I came across the need for a composite key in a code first Entity Framework database for a raffles system. The first table was the raffle setup and would contain an auto generated numeric raffle id and the raffle ticket table would have a relation back to the raffle table (foreign key which was the raffle id).

However as there would be raffles, I needed a non auto generated raffle ticket id which was not unique at a table level, but unique at a raffle level. Being that raffle id 1 could have raffle ticket ids 1 -> 1000 and raffle id 2 could also have raffle tickets 1 -> 1000. Therefore a composite key of raffle ticket id and raffle id (also foreign key was required).

This was achieved by placing a key and foreign key indicator on the raffle id field (on the ticket tabled).

Sitecore set the default domain for the login page

$
0
0
By default, the Sitecore login page will automatically use the Sitecore domain. Which works well for accounts such as sitecore\admin as you only need to enter admin to login. However if you are integrated with active directory, you may want to default the domain to the active directory one.

This can be achieved by modifying a site line in the sites section of the web.config
<site name="login" virtualFolder="/sitecore/login" physicalFolder="/sitecore/login" enableAnalytics="false" database="core" domain="sitecore" disableXmlControls="true" />

TDS error - maximum message size quota for incoming messages

$
0
0
While syncing media items for a project using Team Development for Sitecore in Visual Studio, I came across the following error:
Exception The maximum message size quota for incoming messages (16000000) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
 This error occurs when large content (file size) is being brought into the source control solution. The fix is to open the file located at: C:\Program Files (x86)\Hedgehog Development\Team Development for Sitecore\HedgehogDevelopment.SitecoreProject.VSIP.dll.config and then modify the maxBufferSize attribute.

This may also lead to the error:
Exception For TransferMode.Buffered, MaxReceivedMessageSize and MaxBufferSize must be the same value.
 So the maxReceivedMessageSize attribute also needs to be changed to match the value of the maxBufferSize attribute.

And finally when syncing the offending item (large file size), the following error will occur:
Exception The maximum array length quota (16000000) has been exceeded while reading XML data.


Which means that the maxArrayLength attribute also needs to match the other variables.

Sitecore walkthrough of Email Experience Manager templates

$
0
0
Templates for Sitecore's Email Experience Manager (EXM) are a different process than a standard page layout. However once implemented they have the standard placeholder which can then hold sublayouts/renderings which can then use your existing controls and data!

One note is that email HTML generally has some different requirements than a standard page to ensure it loads correctly in all mail clients (outlook for example). You will need to do some research, but generally all css classes should be inline (not external files) and you should use tables over div elements...

In the default instance of the Email Experience Manager, a template called One-column message is available.


Visually, this layout has two sections available for content entry; main content and footer.


This email template is configured in the content tree at: /sitecore/templates/Branches/Email Campaign/Messages/One-Column Message.


It has five elements, which together make up the email template.

  • One-column message: is a branch template - which in Sitecore allows you to create a set of items rather than a single item.
  • $name: is an AB Test Message template - has the general settings of the email message (such as from name/email, attachments, default include/exclude recipient lists and so on.
  • Message Root: of template message root - is where the layouts and sublayouts are set. 
    • The layout will link to a standard Sitecore layout file (which should of course have HTML optimized for email clients). As shown below, you use placeholders as you would for web layouts.
    • Target item should be the first control in the list and will be used for personalisation. Set Page Title will set the title of the message. Display Body and Display Footer are used to place the content into the pre-defined areas and Process Personalization Tokens (which should appear last in the list) will replace the tokens (first name for example) with the user's detail.
  • Content and Footer: are both custom data templates which are then accessed by the display body and display footer renderings to populate the email. In this case they simply output the text, however you can use tokens and even more complex business logic.

Adding the template to the Email Experience Manager

If you create a custom email template to get it to appear as an option in EXM, you will need to complete the following steps.
  1. For a one time message, navigate to the /sitecore/content/Email Campaign/Message Types/OneTime/Default item.
  2. On the configure menu select assign (insert options)
  3. Here you can modify which templates can be used for email campaign for the given message type.

Branches in Sitecore to automatically have child items

$
0
0
With Sitecore it is sometimes necessary for a given item template to have set children items for each instance. An example would be each template of web page type, having a child item of datasources type (which would be a folder with insert options for the data sources for any sublayouts on the web page item.

Instead of having to manually create the child item for each web page on the web site, the branches concept in Sitecore can be used to automatically add the child item when a parent item is created. Effectively a branch in Sitecore can be used to create a set of items rather than a single item.

To create a branch

  1. Create the parent a child(ren) templates as you normally would.
  2. In the content editor, under Templates> Branches create a new template of the branch type - /sitecore/templates/System/Branches/Branch
    1. Give this branch template a useful name as it will be used for insert options
  3. Under the branch template, insert a template of the parent type and give it a name of $name - this will ensure the parent is created with the name the users enters at insertion time
  4. Insert the child template under the parent template and give it a default name - datasources for example
  5. Assign this branch item as the insert option on the relevant templates instead of the parent item. This way you insert the group of templates instead of a single parent item.
In the example image above, "Web Page" is the Sitecore default branch template. $name is my custom page template (parent) and datasources is my custom datasources template (child).

AngularJS displaying the date suffix - th, st, nd, rd

$
0
0
When displaying date times with AngularJS it is sometimes necessary (for design reasons) to display the date times suffix. That is the th, st, nd and rd element inside a date - Tuesday 26th January 2016 for example.

Out of the box there is no way to do this however there are custom directives/filters available online that make it simple to implement. An example is available on Plnkr which provides the date2 filter, which implments the data suffix via the custom date format "oo". For example {{dt|date2:'MMMM ddoo'}} filters the datetime to appear as Janurary 26th.

Vagrant unable to download box

$
0
0
Whilst trying to download the ubuntu/trusty32 box for Vagrant I came across the following error:
URL: ["https://atlas.hashicorp.com/ubuntu/trusty32"]
Error: Failed to connect to atlas.hashicorp.com port 443: Timed out
This was due to my machine being behind a corporate proxy. To fix this error, setting the proxy details (both HTTP and HTTPS) allowed the box to be downloaded.
set http_proxy=http://[proxy]:8080
set https_proxy=http://[proxy]:8080
The vagrant-proxyconf may also need to be installed, but the command "vagrant plugin install vagrant-proxyconf" doesn't always work - due to the corporate proxy. To install it manually:

  1. Download the gem here.
  2. Place it in the folder where your vagrant file is located and change directory there using a command prompt
  3. Run the command "vagrant plugin install vagrant-proxyconf-1.4.0.gem"

Using Sitecore for an intranet site

$
0
0
In the world of web sites the Sitecore Experience Platform is the market leading CMS, with a feature set that empowers developers, content editors and marketers to deliver optimal results in their relevant areas. However when it comes to intranet sites, SharePoint is still considered the default choice, which only splits the development team and limits the features available for use. This post is going to investigate how Sitecore could be used in an intranet environment, and how it compares to SharePoint in this space.


Key Intranet Features

First of all, the key features of an intranet need to be defined, then an overview of how Sitecore can meet or exceed these features.
  • Forms with workflow: Every intranet site will need to provide forms for a variety of HR and general tasks (such as leave requests, business card requests and even employee satisfaction surveys). Sitecore's web forms for marketers module empowers content authors to create their own web forms with a number of different save actions. By saving the form results to Sitecore items, it opens the door to using the powerful workflows available in Sitecore to workflow form results through any business process(es).

    In comparison, many SharePoint intranet installations rely on third party paid modules such as Nintex Workflows (which also can require training courses to implement the product). 

  • Real-Time data feeds: In the past real time data feeds could have been as simple as news articles/announcements that displayed on the front page of an intranet or departments sub-site. Now intranets are including more social media type interfaces where staff members can share, comment and like on a shared wall in Facebook like manner. This allows staff members to share successes, show what they are working on and have different departments engaging more together. Sitecore can deliver this using a mixture of custom data types/code and it's experience database for a snappy user experience, with all of the data/analytics collection baked in.

  • Content storage/management: Perhaps the most visible purpose of an intranet is the ability to access, manage and update content (whether it be documents or page content). Not only does the Sitecore media library offer a searchable index of documents (and other media types), but you are able to create data structures with complex and even custom data types - and best of all everything is not a list! On top of that is the ability to workflow these content types, even using the same workflows as the form outputs as mentioned above.

  • Security Model: Due to the sensitive nature of content available on an intranet, Security and permissions is an important feature to consider. The HR and payroll departments for example will have data that needs to be kept secure from the average staff member, and executive level managers will also have sensitive information that is best kept safe from leaks. In comes the Sitecore security and permissions model, where you control how granular the security is. It could be as easy as roles mapped to AD groups which then control which areas of the site the user is able to access/manage or an opt-in system where users need to manually be assigned permissions to more secure areas.

The Sitecore difference

Now heres where the sales pitch starts - use Sitecore for an intranet today and you'll get not one, but two content delivery servers for the price of one! Okay, it's not quite like that, but as a Sitecore developer with SharePoint experience, I see a whole lot of benefits which make Sitecore a powerful choice.

  • Experience profiles: Because each user of the Sitecore intranet site is identified (via an AD profile for example), they are known contacts in the experience database and will have an experience profile which can be looked up. This leads to the ability of auditing which users viewed which pages/documents/forms and for how long. Along with monitoring if users viewed key pages (such as health and safety related content).

  • A/B testing: Perhaps not enough staff are completing a satisfaction survey, or they are having trouble finding other key content? A/B or multivariate testing in Sitecore allows content editors to test content to determine which variables lead to more engagement on the web site. Even simple variable such as the color of a button or the text of a hyperlink can affect how many users follow through with an action.

  • Personalization: One problem with intranets is the overload of information, especially when a lot of it is not relevant to a given user. With personalization in Sitecore, you can provide each user with a tailor made experience that is relevant to them. If a user has access to company vehicles, then show them the relevant information, if they are due for a health and safety check, perhaps show a banner ad, and if  a user is a member of a given department, prioritize that departments content (news, documents, events, etc.) on the home page. The benefit here is that the user is primarily seeing content that is relevant to them, so they are getting a better experience out of the intranet and will therefore be more likely to continue using it.

  • Email Experience Manager: Sitecore's email experience manager or EXM, provides email marketing capabilities to Sitecore. In terms of an intranet there are two main possibilities for making use of this module:
    • Triggered email messages can be used to notify users when an action is required on their part. Perhaps an automatic reminder to ensure their details are up-to-date for end of financial year, or notifications of key dates and staff leave absences.
    • Use of templates to create newsletters using the existing intranet content. This allows the company as a whole to send newsletters to all staff, or a given department to their staff. it's simple to use, will make use of existing content and allows for the possibility of personalization as well.

Conclusion

When evaluating which CMS is best for your intranet implementation, Sitecore should be one of the candidates to consider. Not only does it meet the key requirements that an intranet might have, it does them better than other candidates such as SharePoint. For an organisation that has Sitecore development capabilities/experience already it should be an easy decision to use Sitecore, especially when it comes to the content authors that will be using the system day-to-day.

As time as gone on, it's obvious how web content management systems have adapted/innovated to deliver the best value/result to both end users and the development/marketing teams behind them. Can the truth be said about common intranet content management systems?

Sitecore WFFM Error ReportDataProvider

$
0
0
On Sitecore 8/8.1 the following error appears when attempting to load a web form via a content delivery server:
Unable to cast object of type 'System.String' to type 'Sitecore.Analytics.Reporting.ReportDataProvider'

The following section in the config needs to be commented out to stop this error from occuring:
This is a known bug in Sitecore 8.1/update 1 (Sitecore bug #96933).

Sitecore Failed to perform MaxMind lookup

$
0
0
On the Sitecore multi-server setup I was getting errors relating to GeoIP lookup in the CD server logs:
ManagedPoolThread #5 08:52:34 ERROR Failed to perform MaxMind lookup
ManagedPoolThread #5 08:52:34 ERROR Failed to perform GeoIp lookup for [GUID]
Exception: Sitecore.Analytics.Lookups.CannotParseResponseException
Message: Unexpected format. Cannot parse the MaxMind response for IP address: [IP]

Source: Sitecore.Analytics
   at Sitecore.Analytics.Lookups.MaxMindProvider.GetInformationByIp(String ip)
   at Sitecore.Analytics.Lookups.GeoIpManager.GetDataFromLookupProvider(GeoIpHandle geoIpHandle)
This is due to the Analytics.PerformLookup setting in the Sitecore.Analytics.config file. Only one server should be responsible for performing these lookups, so I disabled the lookup on CD servers using a patch file.

Sitecore tracker and sessions errors

$
0
0
The following errors were appearing inside the Sitecore logs:
ERROR Cannot create tracker.
WARN [WFFM] CurrentSession is not initialized
ERROR SessionEndPipeline failed.
These errors relate to the hostname of the site being set incorrectly.

In the Sitecore.config file under the sites node there will be an entry for your Sitecore site. Ensure that the targetHostName value is set to that of your site and that this is also the value that is entered in the hosts file of the server (C:\Windows\System32\drivers\etc).

    Taking your first bite into Sitecore's marketing cababilities

    $
    0
    0
    One of the biggest selling points for Sitecore, and the area which I am really passionate about are the marketing capabilities. More often that not, these take a back seat to the initial implementation of the web site and the inevitable phase two where the nice to haves and additional features are implemented. It's at this point where the site is up and running and there is a baseline of site visitors that you can take your first bite into the marketing suite which Sitecore has to offer.

    I am using the metaphor bite here, because it's important to understand the concepts, plan how they will be implemented on your web site and ultimately review the results. From there you can really start to chew and implement the more advanced marketing aspects.

    What is the main purpose of your web site?

    The initial question I will usually ask before working on a stage one marketing plan for a Sitecore site is: what is the main purpose of the web site? Generally I tend to view websites on a spectrum, which goes from information based to action based.
    1. Information based site: This is a web site that exists to provide information to it's users.
    2. Action based site: This is a web site that ultimately has an action in which you want the users to ultimately perform. An example of an action would be making a purchase from an online store, signing up for a demo and so on.

    The reason this is more of a spectrum in my eyes, is because action based sites will always have information and information based sites will have an action of some sort (even if it's just a contact form). When it comes to concepts such as Engagement Value in Sitecore, this purpose needs to be carefully selected or you end up optimizing the wrong action.

    I always like to ask this question first of all because the answer will drive how the marketing activities are implemented on the Sitecore web site. An information based leaning site would often move towards profiling/personas where as an action based site would put a lot of value into engagement value and optimizing paths/other aspects to generate higher completion of goals.

    Step 1: Setting up traffic sources with campaigns

    Web sites will generally get a lot of their traffic via direct hits and organic search engines, however there will always be traffic sources that have some intervention from the business. These could be in the form of: email campaigns, paid social postings, standard social postings, online advertising and so on.

    By placing Sitecore campaigns on these non-organic traffic sources, you can start to evaluate which sources are bringing in more valuable visitors (those which are more likely to complete an action). You can also start to see what types of user's are coming from which sources and can even make use of concepts such as personalization for each source to optimize the experience for that user set. For example, a Facebook advertising campaign aimed at a specific demographic could have a campaign which then promotes certain products in an online store which is aimed at that demographic. 

    1. Setup the campaign channels in the Sitecore marketing control panel. These channels are the different ways in which a user can come to your web site (both online and offline) and are used for reporting in experience analytics. Sitecore comes with these channels setup out of the box, however you may require some additional channels.

    2. Setup the campaign groups in the Sitecore marketing control panel. These groups are a higher level of classifying the different campaigns and provide a way to link varying channels to one group.

    3. Create your campaigns in Sitecore and make use of Campaign categories to make it easier for maintenance. In the example below there is a Social campaign category which contains 2 campaigns, and the LinkedIn Spring campaign which makes use of the LinkedIn Ads channel and Generic Social campaign group.

    4. Start using the campaign! You can either manually add the campaign link to a URL, which would look something like mysite.com?sc_camp=BE54EDED3D8341D2B958E9E0A91133FA or you could assign the campaign to a content item (such as a landing page). 

    Now you can start to view the data collected about campaign visitors, which can then be used to make future marketing decisions. This data is available under experience analytics.



    The data table above is actually showing value, conversion rates, bounce rates and average pages visited for each campaign. This data is extremely useful when it comes to optimizing your paid traffic sources, as you will often find that some perform much better than others.

    In one Sitecore implementation, I placed campaign links on the social share buttons available to site browsers. This allowed advanced tracking on users which came to the site from organic social postings and gave an indicator where paid social postings would be most beneficial.

    Step 2: Defining goals

    In Sitecore, a goal is effectively an activity which a user can complete. Example goals would be: filling out a form, purchasing an item from a shop, sharing a page on social media or downloading a media library item. These goals can then be used to optimize the web site and also see how your traffic sources/multivariate tests stack up. 

    You should create goals for the key actions on your site in which you want users to complete. Because you don't want to optimize on many less important goals, and want the analytics around them to be strong. 
    1. Define the key activities on your site and create goals for them

    2. Assign the goals to their relevant actions. This may be via the item if the goal is visiting the page, via web forms for marketers for form completion and programatically for any custom logic.
    The data collected around goals can now be viewed inside the Experience Analytics database, under the goals section. As you can see it goes into detail of the statistics on users who converted, along with when.



    Remember that these goals are also known as conversions, so in the previous example on campaigns, you can see with the analytics data which campaigns led to more conversions (or goals completed).

    Step 3: Perform an A/B test

    A/B testing is a way of testing an element of the site with multiple versions to see which one performs better (in terms of goal conversions and visitor engagement value). An example of this would be testing the text on a button to see which results in more people clicking the button. You may think such a minor change inconsequential, but even minor changes in text can have different impacts and this can be tested using Sitecore's A/B testing. 

    Multivariate testing is an expanded concept of A/B testing where you are doing multiple tests at the same time. An example would be 2 variations on a buttons text and two on it's style/color. This would result in 4 different variants - because each color of button needs to be tested with each text. As you can imagine multivariate tests can get rather large, but that also means a large uses base is required to get a meaningful analysis. As with all A/B testing the larger the user base, the more accurate the results.

    For an initial A/B test, I would recommend doing a simple test on a call to action of some sort. This may be the text of a link/button which is used to get the user to request a demo (much like the button on Sitecore's web site). It could also be a homepage element which is trying to get the user to visit a page to find out more about a product/service. The goal here is to get a simple test running, to see the output and give the business users confidence in planning/implementing more advanced tests in the future.


    Step 4: Personalize something

    Instead of putting up content in a shotgun approach hoping that the user finds the content which they need/are interested in, personalization can be used in Sitecore to provide the user with the right information at the right time. Defining personas/profiles and assigning pattern cards on each Sitecore content item takes a lot of planning and effort from various areas of the business. As this post is about taking your first bite out of Sitecore's marketing capabilities, I recommend a simpler personalization option to start off with.

    By using one of the campaigns created earlier for a given traffic source (be it an advertisement or social post), you can personalize an area of the site for visitors whom have triggered that campaign. A good example might be personalizing a banner image/slider carousel for visitors who have come from Facebook advertising, the call to action could be getting them to like your companies Facebook page. If you have a campaign assigned to a given Google Ad Words spend, you could then personalize elements based on users that came from that specific keyword/phrase.

    It's also simple to implement personalization based on geographic location. This works well for businesses which operate in various states or countries. An easy point to start with this is to personalize the main contact details based on which office/location is closer to the user's geographic location.


    Next steps

    The goal of this post is to provide some easy to implement marketing features in Sitecore which will provide better analytics for the site administrators and at the same time provide a better experience for the users. Once these features have all been running for some time to get a baseline, more advanced marketing concepts can be brought into play. The idea is to skill up the relevant stakeholders so that they have a decent understanding before getting into the multivariate testing and personalization personas.

    Further Reading



    This post makes use of the Jetstream Sitecore demo site for screenshots of analytics data.

    Sitecore content editor Post condition failed

    $
    0
    0
    On a Sitecore development machine (single server environment), the front-end was loading correctly but when attempting to load the content editor the following error appeared in the logs:

    Post condition failed


    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

    Exception Details: System.InvalidOperationException: Post condition failed

    Source Error: 

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace: 


    [InvalidOperationException: Post condition failed]
       Sitecore.Diagnostics.Assert.ResultNotNull(T result, String message) +85
       Sitecore.Web.UI.HtmlControls.Data.DataViewFactory.GetDataViewByName(String name) +855
       Sitecore.Web.UI.HtmlControls.Data.DataViewFactory.GetDataView(String name, String parameters) +63
       Sitecore.Web.UI.HtmlControls.DataContext.get_DataView() +359
       Sitecore.Web.UI.HtmlControls.DataContext.GetItem(String id) +42
       Sitecore.Web.UI.HtmlControls.DataContext.GetState(Item& root, Item& folder, Item[]& selected) +670
       Sitecore.Shell.Applications.ContentManager.ContentEditorForm.OnLoad(EventArgs e) +541

    [TargetInvocationException: Exception has been thrown by the target of an invocation.]
       System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
       System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +128
       System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +146
       Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj) +89
       Sitecore.Web.UI.Sheer.ClientPage.OnLoad(EventArgs e) +592
       System.Web.UI.Control.LoadRecursive() +68
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4498


    This was due to a switch master to web config file being included in the deployment package. Removing this file corrected the error

    Visual studio solution nuget targets not found on opening project

    $
    0
    0
    When attempting to open a visual studio project that contains nuget packages from a custom source on another environment, the following error may appear:
    The imported project [project location]\.nuget\nuget.targets was not found. Confirm the parth in the <import> declaration is correct, and that the file exists on disk. [project location]\[project name].csproj
    The fix here is to open the project file (csproj) in notepad and remove the following lines:
    <RestorePackages>true</RestorePackages>
    <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
     Then also remove the .nuget folder if it is present as well.
    Viewing all 287 articles
    Browse latest View live


    Latest Images