Social psychology applied to online persuasion contexts such as ecommerce websites

If you work in an ecommerce environment or you’ve done any conversion rate optimisation work you’ll likely be familiar with Robert Cialdini‘s six principles of persuasion which he wrote about in his seminal book: Influence: The Psychology of Persuasion.

There are a number of good articles online showing how many ecommerce shops have applied these principles in order to try and sell more. Some good examples include 6 Psychological Triggers that Win Sales and Influence Customers and How to Use Cialdini’s 6 Principles of Persuasion to Boost Conversions

I wrote the below article for an applied psychology assignment for my psychology hdip. It was my attempt to look scientifically at these six principles in the context of online persuasion and specifically ecommerce. I’m reposting here as I hope it will be of interest to some.


Cialdini (1984) made significant contributions to the literature related to persuasion when he synthesized his own direct experiences and research as well as previous research into six key principles of persuasion including reciprocity, social proof, scarcity, authority, liking and commitment and consistency. These principles all have their roots in social psychology. Commitment and consistency, social proof and authority for example are based on the major social psychology theories of cognitive dissonance (Festinger, 1957); conformity (Asch, 1951) and obedience to authority (Milgram, 1963) respectively. The present essay uses Cialdini’s persuasion principles to frame a discussion about the applied value of select social psychology topics to online persuasion contexts such as ecommerce websites.


A number of authors (Falk & Fischbacher, 2006; Gouldner, 1960) have discussed reciprocity which refers to the social norm that obligates individuals to repay in kind a gift or favour they have received. Gouldner (1960) notes that this social norm is so widespread that there is no human society that does not subscribe to it. Given that society knows the social sanctions and derision applied to those that violate the principle of reciprocity Cialdini (1984) writes that people will often go to great lengths to avoid being known as someone who doesn’t adhere to this norm. According to Cialdini (1984, p. 16) the principle of reciprocity is powerful as a persuasion device as it often produces the desired response to a request that, but for the sense of indebtedness created in someone who has received a gift would surely have been rejected.

Meurs (2013) discusses this social psychology principle in the context of ecommerce and specifically conversion rate improvement noting that ecommerce websites can apply this principle by offering valuable or exclusive information or presenting valuable offers such as whitepapers or personal quotations. Meurs suggests this will cause visitors to remember the website and also might cause them to recommend the website to other consumers such as their friends on Facebook or Twitter.

In their review of persuasion techniques used on tourism websites, Ibrahim, Shiratuddin and Wong (2013) provide further examples such as the offering of valuable information such as ‘the most visited cities in the world’ or ‘542 things to do in Sydney’. These authors also provide the common example of a discussion forum facility which allows visitors to engage with a website, eventually get recognition among other forum users and in return feel loyalty and obligation towards the website. These tactics are not always intended to persuade visitors to purchase directly but rather as alluded to by Ibrahim et al. (2013) reciprocation is about giving something to or doing a favour for a visitor without expecting anything immediate in return. In the end however they note that, because the visitor feels obligated to repay the favour or gift, reciprocation serves to create a relationship between the visitor and the website which in turn increases the likelihood of the visitor purchasing from the website in the future.

Social proof

A particularly important persuasion principle in an ecommerce setting is social proof or conformity. Cialdini (1984) notes that this principle relates to how people have a tendency to see any action as more appropriate when others are doing it. This tendency to conform is a fundamental topic in social psychology and is based on experiments by Asch (1951) and Sherif (1936). In Asch (1951) participants were asked to match a reference line with one of three comparison lines publicly in a group context. Given that a number of confederates deliberately chose obviously wrong answers, Asch believed that if the participant gave an incorrect answer it would be clear that this was due to group pressure (McLeod, 2008). His reported results indicate that on average, about one third of participants conformed with the group and gave the clear incorrect answer, whereas 75% of participants conformed at least once. When contrasted against an incorrect answer rate of 1% among control participants Asch’s experiment gives clear support to the notion that people have a tendency to conform to perceived group norms.

Application of this conformity tendency in persuasion contexts such as ecommerce websites on the internet is commonplace. The prime example being that of product reviews which countless websites such as Amazon have used in order to allow visitors to see what products and services are most popular with its visitors. Support for notion that product reviews can affect sales and therefore conversion rates in ecommerce contexts is provided by a number of authors (Chevalier & Mayzlin, 2006; Zhu & Zhang, 2006). Chevalier and Mayzlin looked at the relative effects of book reviews on compared with and found that an improvement in a book’s average rating correlated with an increase of sales at that site relative to the other site. Similarly Zhu and Zhang (2006) reported that a one point increase in average review rating for a product was associated with a 4% increase in sales for that product.

Aside from product reviews and ratings, Meurs (2013) discusses other means of enhancing social proof in order to persuade visitors to buy online including displaying the amount of sales for a particular product or service, bestselling products and the amount of Facebook likes and tweets which a particular product or company might have. Amblee and Bui (2012) developed a model to understand the factors which affect coupon sales on daily deal ecommerce websites and using to empirically validate their model found that social proof does indeed play an important role in demand generation for deals. These authors report that implements the social proof principle by prominately displaying how many other people have already purchased a deal as well as the number of social media shares for each deal. Similarly a case study of (Chawla, 2013) reported how this website increased registrations by 7% by replacing an existing web page element relating to the availability of betting on mobile phones with an element mentioning the number of facebook likes which the company recieved.


Another concept from social psychology which has been applied to persuasion by Cialdini (1894) is scarcity. Scarcity relates to how people perceive the importance or value of something to increase as its availability becomes increasingly limited and is based on commodity theory (Brock as cited in Lynn, 1991). Cialdini (1984, p. 180) notes that the most straightforward use of the scarcity principle in persuasion marketing occurs with the limited availability tactic when people are explicitly told that only a small amount of something is available and often only for a limited time.

Authors such as Dooley (2011, p. 252) and Weinschenk (2009, p. 45) offer examples of this principle being applied online, while Kaptein (2011) provides empirical support for its effectiveness. Dooley (2011, p. 252) reports of sites like Amazon who regularly display messages such as ‘Only 4 left in stock – order soon’ as well as airline websites which he notes often display messages such as ‘1 ticket left at this price’ in an attempt to apply the scarcity principle and get people to buy more of their stock. Additionally in their review of persuasion techniques used in tourism website design Ibrahim et al. (2013) report scarcity messages being present on the australian versions of three leading travel websites include Yahoo Travel, Travelocity and Expedia.

A study by Kaptein (2011) looked at the effect of displaying a scarcity message on product detail pages on a children’s clothing affiliate website based in the Netherlands to see if its presence would increase the amount of clicks on the ‘Buy Now’ button present on all these detail pages. As noted by Kaptein the scarcity message read “This clothing item is available today at a special discount rate” [Italics added]. Although the research pertains to an affiliate rather than a dedicated ecommerce site the setting is sufficiently similar that a statistically significant increase in clicks on the ‘Buy Now’ button would generalize and thus provide support for the use of scarcity messages on ecommerce websites. Despite limited data due to relatively low visitor numbers Kaptein did indeed report a statistically significant increase in the number of visitors clicking through to the affiliate site when comparing the no scarcity message with the scarcity message condition.


Cialdini’s (1984) authority principle is based the obedience to authority research of Milgram (1963). Milgrams series of social psychology experiments shone light on the tendency of people to obey and trust authority even in extreme cases such as when asked to do objectionable things like electric shock another human being. In the context of online persuasion the authority principle is often deployed through celebrity endorsements, recommendations, security related trustmarks (Hu et al., 2003; Shu & Cheng, 2012) and the listing of memberships and affiliations (Saleh & Shukairy, 2010, p. 111) all with a view to making the website more authoritative and in line with Milgram (1963) more trustworthy.

According to Ibrahim et al. (2013) trust level towards a website is a major influence towards purchase intention and thus websites, and in the case of their research tourism websites in particular should pay attention to methods which can improve this. These authors report that one way of triggering trust in a website is with authority. Evidence which suggests authority can play a role in an ecommerce persuasion context is provided by Shu and Cheng (2012) who report that the presence of a notable trustmark seal on shopping websites along with a proper explanation improved consumers’ negative attitudes toward using credit cards online. In the case of Shu and Cheng the trustmark was that of a recognized authority in the secure online payment industry displayed in order to persuade visitors their credit card information was safe and thus increase the likelihood of them purchasing something online. Hu et al. (2003) also reported that displaying a trusted seal could promote online trust and influence consumers willingness to shop online.


Cialdini (1984) notes that likable people are more influential and thus have more power to persuade others. Cialdini discusses a number of factors which produce liking including physical attractiveness, similarity and compliments. Given that similarity is one of the components of liking this principle has often been implemented with ‘about us’ pages (Dooley, 2012) which seek to humanise a company and its staff, endorsements and testimonials as well as product modelling by peers and other people similar to a websites visitors (Weinschenk, p. 95).

Research discussing the effectiveness of this principle in an online context is limited and those studies which do exist provide mixed results. One study albeit not based on an ecommerce setting by Guadagno, Muscanell, Rice and Roberts (2013) reported that likeability was not applicable online. Guadagno et al. controlled for likeability of the author of a number of blog posts which asked for volunteers to help with a university related fundraiser. While participants did rate the likability of the blog post author in line with their randomly assigned condition it did not impact their willingness to volunteer.

In a study with online consumers in Germany, Holzwarth, Janiszewski and Neuman (2006) controlling for attractiveness of avatar found that attractive avatars were more persuasive than non attractiveness avatars. These findings contrast with those of Guadagno et al. (2013) and support that notion that Cialdini’s likability principle may have applicability online afterall. Lim, Sia, Lee and Benbasat (2006) also provide support for this notion. These authors investigated  the effectiveness of various trust-building strategies to influence actual buying behavior in online shopping environments. They reported that endorsements by similar peers but not by dissimilar peers were effective means of development trust among first time visitors to online stores.

Commitment and consistency

Forming the basis for Cialdini’s (1984) commitment and consistency principle, a major theory from social psychology is cognitive dissonance theory (Festinger, 1957) which relates to how people tend to seek consistency in their attitudes, words and behaviours. According to Cialdini (1984, p. 45) consistency is so powerful a motivator as people are keen to be seen as having positive traits such intellectual strength, rationality, stability and honesty while also keen to avoid being labelled as indecisive, confused or two-faced which are traits that society attributes to those that have high and low levels of consistency respectively. Having noted the power of peoples desire for consistency, Cialdini (1984, p. 51) writes that the best way to actually use this in a persuasion context is to get people to commit to something, preferably publicly and in such as way that the person believes they are committing voluntarily.

According to Meurs (2013) some examples of how ecommerce retailers might get this commitment include encouraging their visitors to subscribe to email newsletters, to explore online shops more thoroughly and to add products to a wish list. This author writes that when a website visitor adds a product to a wish list, they have made a form of commitment and thus once this has happened they are more likely to purchase the product. Weinschenk (2009, p. 84) also notes how positive online reviews can also be a form of commitment, as while these act as a form of social proof on others they act as a form of commitment on the reviewer. Since the reviewer has wrote a positive review of a company or one of its products, they will then want to stay consistent and as Weinschenk (2009, p. 84) writes this means they will take more action to interact with the website and the company. This author thus recommends giving visitors the opportunity to write reviews.

While Cialdini’s commitment and consistency principle seeks to create cognitive dissonance with the knowledge that it is likely people will act (buy a product for example) to minimise it, it is worthwhile noting that cognitive dissonance can also act as a barrier to sales and thus can be quite detrimental to ecommerce websites. Support for this notion is provided by Alhammad et al. (2013) who citing Kikar-Kinney and Close (2010) discuss the high percentage of online consumers who use the web to search for products and services but abandon their shopping cart before purchase. Alhammad et al. suggest that these negative purchasing decisions are likely due to cognitive dissonance created by information that is either inconsistent with an online consumers internal beliefs about products, services or retailers or information that simply fails to address and minimise the anxieties which customers have about purchasing online. As an example, consider the dissonance created when someone who believes their credit card information is unsafe at a particular website is considering purchasing something from that site. In this case it is very likely that they will end their shopping experience on the site without purchasing because to do otherwise would be to act inconsistent with their beliefs and thus might create more cognitive dissonance.

Additional support for the role of cognitive dissonance in ecommerce contexts is provided by Koller, Salzberger and Streif (n.d). These authors looked at the level of post book purchase cognitive dissonance by asking study participants questions such as “When thinking about my decision I feel uncomfortable” [Italics added] in retail and online sales channels for the same company and found that cognitive dissonance was significantly larger online (77.8%) than in retail (28.4%). These authors had indeed expected higher cognitive dissonance via online channels compared to offline/retail channels due to the virtual nature of product inspection online and the time lag between payment for and actual receipt of the book. In addition to reporting levels of cognitive dissonance these authors also reported that the main antecedent of this dissonance was trust. Although a number of limitations to the research exists such as limited sample size this study does provide support for the notion that cognitive dissonance is indeed significant in ecommerce environments. Knowing this, ecommerce managers should seek to alter their designs, copy and offerings to minimise the chances of dissonance playing a role in a non purchase scenario.


Cialdini (1984) provided insight into how social psychology principles such as conformity and cognitive dissonance can be used in offline persuasion contexts and while anecdotal support for the use of these principles in online persuasion contexts is plentiful, empirical research supporting their effectiveness online is limited. Further work is therefore needed to validate these principles online, however the small evidence base currently available does indeed support their use in persuasion contexts such as ecommerce websites. Social proof which is based on the concept of conformity in particular seems to be a powerful persuader.

** Note **
References for original article available on request

Performing commands on all tables in SQL Server database using the sp_MSforeachtable store procedure

From time to time I have a need to do an operation such as dropping all records or disabling all triggers for all tables in an database. Scripts using cursors can be used here, but an undocumented stored procedure sp_MSforeachtable residing in the SQL Server master DB can also be used.

Below are a couple of different uses cases for this sproc from disabling all triggers, updating statistics, checking row counts etc. Note, this stored procedure is undocumented so could be dropped or modified anytime so best not to rely on it in any of your production scripts but I’ve found it very handy in adhoc situations like prepping a DB for UAT. If you’ve got other examples of use, please send them on.

Disable all triggers
exec sp_MSforeachtable ‘ALTER TABLE ? DISABLE TRIGGER ALL’

Enable all triggers
exec sp_MSforeachtable ‘ALTER TABLE ? DISABLE TRIGGER ALL’

Disable all constraints
exec sp_msforeachtable ‘ALTER TABLE ? NOCHECK CONSTRAINT all’

Enable all constraints
exec sp_msforeachtable ‘ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all’

Delete records in all tables
exec sp_MSForEachTable ‘DELETE FROM ?’

Truncate all tables (won’t work if any FKs)
exec sp_MSForEachTable ‘TRUNCATE TABLE ?’

Rows, size, space info for all tables
exec sp_MSforeachtable ‘exec sp_spaceused [?]’

Print all table names
exec sp_MSforeachtable ‘print “?”‘

Update statistics
exec sp_msforeachtable ‘UPDATE STATISTICS ?’

Defragments all indexes
exec sp_msforeachtable ‘dbcc indexdefrag(0, “?”)’

Reseed all tables
exec sp_msforeachtable ‘DBCC CHECKIDENT (“?”, RESEED, 0)’

Reindex all tables
exec sp_msforeachtable ‘dbcc dbreindex(“?”)’

Update a particular column. Column MUST EXIST ON ALL TABLES, otherwise execution will stop upon coming to a table without the column without a rollback.
exec sp_MSforeachtable ‘UPDATE ? SET Updated_by = ”DAVID”’

Add a column to all tables. If column already exists execution will continue.
exec sp_msforeachtable ‘alter table ? add flag bit not null default 0’;

Remove column for all tables. If column doesn’t exist execution will continue. Delete dependencies first.
exec sp_msforeachtable ‘alter table ? drop column [flag]’

Row count for all tables
create table #rowcount (tbl_name varchar(100), row_count int)
exec sp_MSforeachtable ‘insert #rowcount select ”?”,count(*) row_count from ?’
select * from #rowcount order by tbl_name
drop table #rowcount

Number of rows updated since a certain date. Assumes all tables have an auditing date column on it. Tables which don’t have the column will not cause execution to stop.

create table #updateddaterows (tbl_name varchar(100), row_count int)
exec sp_MSforeachtable ‘insert #updateddaterows select ”?”,count(*) from ? where Updated_date > ”20160101” having count(*) > 0’
select * from #updateddaterows order by tbl_name
drop table #updateddaterows


Number of rows updated by a user since a certain date.
create table #updatedbyrows (tbl_name varchar(100), row_count int)
exec sp_MSforeachtable ‘insert #updatedbyrows select ”?”,count(*) from ? where Updated_by = ”12345” and Updated_date > ”20160101” having count(*) > 0’
select * from #updatedbyrows order by tbl_name
drop table #updatedbyrows

Related Links

Article looking in detail at the parameters sp_msforeachtable takes

What to look for when reviewing code for SOLID principle ‘violations’

If your tasked with doing a code review of a fellow developers code or indeed are looking to improve an existing code base as a whole, one good set of principles to review the code by is the SOLID principles by Uncle Bob.

There are five SOLID principles in total and these courtesy of Wikipedia are:


Here’s what you should keep an eye out for if looking for violations of these principles:

Single responsibility principle – look for large classes which contain lots of functionality, chances are those classes could be broken up into smaller more focused ones. When your dealing with already small size classes the line is a little less clear as really what is the definition of ‘single’.

Open/closed principle – look for long blocks of if/else statements which check an object’s type and then does some similar action X (but differently) based on the result. When you add a new relevant type the class with this if/else type check code has to be modified to accommodate the new type, whereas the better way would be to use polymorphism either through interfaces or abstract classes.

Liskov substitution principle – this one may be a little tougher to spot and indeed is it often the toughest principle for developers to grasp. Look for subclass methods which change the behaviour (even if only sometimes) of a base class method in such a way that consumers can’t call the derived method and have it ALWAYS behave as if it was the base class method. To find LSP violations look for things like:

Subclasses with overridden methods which throw NotImplementedException().

Subclass methods which enforce stricter rules on parameters than their base.  For example… a base method accepts an integer as parameter but overridden method throws exception if this integer is not positive.

Methods which appear from a signature point of view to operate on a base class (or interface) but then within the method some type checking occurs. 

Interface segregation principle – look for large (fat) interfaces with a lot of unfocused methods, also look at interfaces whose clients throw NotImplementedException() a lot.

Dependency inversion principle – look for a lot of new statements.  New statements means concrete instantiations, which means coupling. Better to use a dependency injection framework or even (if you must) poor man’s dependency injection and push the creation of your objects up higher in the stack while simply passing down interfaces which provide a functionality contract but which makes no assertions about how that functionality is implemented.

Related Links

Overview of the five different principles. I always seem to be reading this article come interview time.

CheckBoxFor values not binding when output using foreach loop

If your outputting a list of checkboxes using CheckBoxFor from within a loop and are having problems getting the checkboxes to bind back when submitting make sure you are looping with a for loop rather than a foreach loop. This is because looping through a collection with a foreach loop will output the same name for all checkboxes which will be based on the name of the iteration variable (not the particular item in the viewModel collection) in your foreach statement and the name of the bool property and thus MVC will not find anything to bind to.


Determining which of multiple submit buttons triggered a HTTP post to an MVC action method

You can have multiple non nested forms all posting to different action methods from different submit buttons, you can also have multiple submit buttons posting to the same form and hence action method. In an MVC action method which is posted to by multiple submit buttons, how does one tell which button was responsible for the form post? Two easy ways are outlined on stackoverflow which I’m reposting as is here just to add a bit of extra ‘commentary’. Author is highlighted in yellow.

  1. In your razor mark-up each submit button has a different name property. Since only the name of the button which caused the submit will be posted in the HTTP request header, in your action method you can check the Request.Form collection to see which submit button property name exists and take action accordingly. In this case you don’t have to change your action method signature and given that the value property of your submit buttons is insignificant to determining which button was pressed, all your submit buttons can have the same label/text if needs be.
  2. In your razor mark-up each submit button has the same property name but different value, since only the name (and significantly value) of the button which caused the submit will be posted in the HTTP request header, you can add a property to your action method signature for MVC to bind to and populate. You can then check the value of that property and take action accordingly. This is the more MVC (and perhaps elegant) way I guess as your using default model binder rather than checking form collections directly, personally however I prefer the approach above as you don’t have to change the action method signature and the button test is not based on some visible on page property which could matter in some scenarios.image007

    Related Links – Stackoverflow page with a number of solutions including the two above and an AJAX based one too.