Tag Archives: enterprise

Eating Our Own Dogfood – How To Optimize For Revenue As A SaaS Business

It wouldn’t be an exaggeration to say that we at VWO are very passionate about experimentation.

Not only have we built a product around A/B testing and conversion optimization, but we are always looking for ways to run experiments on our website.

Recently, we got our entire team to actively research and contribute ideas for optimization on our website and ran multiple tests. This post is a narrative of what we did after.

Who Is This Post for?

This post will help SaaS growth-hackers, marketers, and optimization experts to predict the business value from a test.

The aim of this post is to not only share the tests we ran on our website, but also introduce a revenue-based framework that predicts the business impact of an A/B test and prioritizing on the basis of it.

Revenue-Based Optimization

Need for a Model

After we propelled our team to suggest ideas for testing, we had more than 30 hypotheses looking at us, but no distinct way of knowing which of these to take up first. Of course, there is a range of prioritizing frameworks available, but we particularly wanted to look at the ones that would directly impact our revenue.

This framework helped us project the potential impact on the revenue from each test. Here’s what we did:

Step 1

We decided to identify high-impact pages and winnow the pages that were not as important for our business, that is, pages where no goal conversions take place. We looked at Google Analytics for pages with the:

  • Highest Amount of Traffic
    (We used “New Users” to nullify visits by existing customers.)
  • Highest Number of Goal Conversions
    (Goal conversion, which contributes to your overall business goal, is the main goal for your website. In our case, this meant all qualified lead-generating forms. A free trial or request a demo qualifies a visitor as a lead with a genuine interest in our product; or, as the industry popularly refers to it, a Marketing Qualified Lead.)

This gave us a list of pages which were high-value in terms of, either traffic generation or last touch before conversions.

We identified the following key pages:

  • Free-trial page
  • Request-a-demo page
  • Homepage
  • Pricing page
  • Features page
  • Blog pages (All)
  • Contact-us page

Step 2

Our main objective was to project an estimated increase in the revenue due to a particular test. If your test increases the conversion rate by say 20%, what would this mean for your business and, in turn, the revenue?

This is how our marketing funnel looked like:

VWO Marketing Funnel

Note: You should use data from the recent 3–6 months, and the average (mean) of each step. This is to accurately reflect what to expect from your testing and be relevant to your business.

For each of the “Key Pages” we identified in the first step, we also dug out the corresponding numbers at each funnel stage. We’ve explained each stage of the funnel and how it is calculated:

a) Key Page Traffic: The total number of pageviews per Key Page (new users in our case). You can find the data in Google Analytics.

b) Total Conversions: The total number of leads generated from each particular page. If there is an additional qualification your company follows, source this data from your preferred CRM or Marketing Automation software. For example, at VWO, we use Clearbit to qualify our leads in Salesforce.

c) Opportunities: The total number of opportunities generated for your sales team. This data will be available in your CRM; make sure to count qualified opportunities only.

d) Customers:  The total number of customers created in a month.

e) MRR (New): Or monthly recurring revenue, means revenue booked on a monthly basis; you can use this to estimate annual recurring revenue, or ARR, as well.

Step 3

Now that we had all the numbers needed in our arsenal, I decided to calculate some more internal benchmarks. This gave us the performance of our marketing and/or sales funnel.

  1. We computed the conversion rate of a particular page, using the following formula:
    Existing conversion rate = (Total Conversions Key Page Traffic); this is represented as %
  2. The conversion of your leads into opportunities:
    (Opportunities ÷ Total conversions) × 100, represented as %
  3.  The conversion rate of opportunities into customers:
    (Customers ÷ Opportunities) × 100, represented as %
  4.  The average revenue per user or ARPU:
    Total MRR  ÷ Total number of paying customers

Now all you have to do is to impute these numbers in this template.
Revenue-based Testing Model
The model uses all of that data and projects how much revenue increase or decrease you can estimate based on your test results. This estimate can give you a good idea of where to begin or prioritize your testing.

Step 4 (Optional)

This is where it may get tricky. At VWO, we sell both Enterprise plans and Standard plans. So to be fair, we must estimate each cohort with separate data and individual conversion rates.

For example, Opportunity creation % for an Enterprise plan may be lower, but a Standard plan is easier to convert. You may want to decide what type of plan do you want to focus on.

We, for instance, used website traffic and Alexa rank as the benchmark for lead qualification. We attributed more value to the leads that came in through key pages and prioritized them.

This led us to the next step, which is the qualification rate of the said lead of high value. This rate may be in the range 30–50%, depending on your definition.

It was interesting to note that each page had a different qualification rate. For example, we get better quality leads from our Request a demo page than we do from our free trial or blog post page.

Tests Conducted:

After we had the model in place, we played around with the increase or decrease in our conversion rates. This was to identify what would be our best optimization opportunities?

The free trial pages and the home page were among the high-priority pages, in terms of the impact of revenue. (Unfortunately, I can’t share the exact numbers with you.) We first looked at the hypotheses on the free trial page:

Test 1 – Free Trial Page

Our hypothesis was “Illustrating VWO features and social proof on the free trial page will compel users to sign up for the free trial.”

Here is a screenshot of what it looks like in VWO.
hypothesis-free-trial

Bonus tip: VWO has recently launched a new capability called PLAN that lets you manage and prioritize your testing hypotheses. To learn more about this capability, visit the VWO evolution page.

This is what the control looked like:

Free Trial Control

Our heatmap data also showed a lot of users clicking the features page after accessing the free trial page.

Screenshot of heatmap data:

Heatmap Screenshot for test

We created a variation which included the features we offer to solve this issue. Here’s a screenshot of the same.

This is our current free trial page:

Free Trial Page(New)(Variation)

We ran the test for over 2 months. The result was an increase of 6% in our conversion rate, which led to increased revenues.

Test 2 – Request a Demo CTA (A/B Test)

The main CTA on the homepage has been the free trial CTA. The headline on the homepage was “A/B Testing Software for Marketers.”

The hypothesis for the test was “We will get more qualified leads through a request a demo CTA on the homepage.”

This is what the control looked like:

Homepage Control

We came up with a more targeted copy and changed the existing CTA to Request A Demo. Here is what the variation looked like:

Homepage variation

We also wanted to change our positioning due to our foray into Conversion Optimization. The results from this test were that our variation beat the control and had more than 31% improvement in the conversion rate.

Based on the first example, we have already implemented the new free-trial page as our main free-trial page now. Based on the second test, we updated our current home page.

All in all, this model helped us correctly predict the best optimization opportunities, make our testing better, and more strategically aligned to business goals.

Let me know your experience with this model and how you go about testing.

Would love to hear your feedback on this!

Free-trial CTA

The post Eating Our Own Dogfood – How To Optimize For Revenue As A SaaS Business appeared first on VWO Blog.

Read more – 

Eating Our Own Dogfood – How To Optimize For Revenue As A SaaS Business

5 Conversion Rate Optimization Challenges For Enterprises To Solve

Although the interest in conversion rate optimization is increasing over time, organizations are unable to adopt it fully. To ensure its smooth adoption and implementation, certain challenges and misconceptions need to be addressed.

interest in conversion rate optimization google trends
Google Trends

In this post, we will talk about 5 such conversion optimization challenges that enterprises face and ways to overcome them.

Challenge 1. Politics and People—A Cultural Challenge

An organization’s culture is made of 2 core components—people (skill and mindset) and their interpersonal relationships (power to influence and politics ). Creating a conversion optimization culture becomes challenging when either people lack the understanding and skill or when influential people in the organization want their opinions to be valued more than what data and facts indicate.

Political

Brian Massey, Founder, Conversion Sciences shares his view on the political challenge as follows:

Brian Massey

Why has Donald Trump’s top-down, opinion-driven leadership style been accepted by the white-collar working public in the US? Because enterprise businesses have trained us that this is how leadership works. We have a name for this leadership style: “HiPPO,” or Highest Paid Person’s Opinion. Joel Harvey calls it Helicopter Management. This is the management style of charismatic or autocratic leaders who drive action in their organizations by helicoptering in, expressing a lightly-informed opinion, and enforcing their opinion in one of the following two ways:

* They bestow budget upon the loyal.

* They threaten the jobs of the disloyal.

So marketing teams can grab the budget and buy the latest tools. But they then struggle to find the man-hours necessary to make the tools effective.

Like all big business problems, it’s a cultural issue.”

James Spittal, Chief Executive Officer, Web Marketing ROI also talks about the HiPPO effect and the political challenge that obstructs a culture of conversion rate optimization.

James Spittal

Only a small portion of changes are A/B tested, kind of like the “HiPPO” effect. The typically small and under-resourced internal CRO team madly tries to work with an agency to get as many A/B tests launched as possible and keeps up their A/B test velocity while talking to everyone about CRO. Meanwhile, a C-level executive asks for a change to be pushed straight into the source code base without it being tested, costing the organization potentially millions of dollars and because they don’t know any better.

Keith Hagen, VP & Director of Conversion Services at Inflow views politics as an obstacle in the implementation of quality insights for any CRO program.

Keith Hagen

Not all insights are equal. One insight can be worth millions; the other may not move the needle at all while the enterprise pays its employees to test and implement that insight as well.

Terming what an insight actually is, is important as well. Insights come from customers and identify a customer obstacle or opportunity.  If you are not making something better for the customer or capitalizing better on what you have, it should not be worked on. Enterprise organizations have a lot of voices, and the higher paid voices tend to influence what optimizations are made to a site.

The solution he proposes—Score Insights Based on Their Potential.

Every insight should be scored on its potential and shared across the organization. Whether the insight is about an obstacle to a purchase or an opportunity to sell more, the potential should be assigned a dollar value so that it is clear what NOT working on the insight will cost.

People

James Spittal, Chief Executive Officer, Web Marketing ROI attributes the lack of skill—technical or development—with regard to why people in an organization pose a challenge to creating a culture of CRO.

James Spittal

This challenge simply occurs because of people in an enterprise not having the knowledge, talent, or skills. Often, we see people with a graphic design, pure web design, pure analytics, or pure UX background become the “de facto” CRO team. But they struggle because it’s unlikely that they have the technical skills or development skills to be able to implement advanced A/B test ideas (major layout changes, modals, segmentation, changing cart flows, doing tests on pricing, etc.). Often, they also struggle to get resources internally or externally and build a strong business case to increase the CRO budget.

Johann Van Tonder, COO, AWA Digital, shares similar views regarding people and the lack of talent to implement conversion optimization.

Johann Van Tonder

The challenge is to find good optimization talent. While there is no shortage of people marketing themselves as CRO practitioners, only a small percentage of the candidates we screen make it into our organization. This is the same pool that enterprises are recruiting from.  

A good optimizer is both analytical and creative, with a solid grasp of disciplines as diverse as psychology, copywriting, marketing, and statistics. They are brilliant communicators with an entrepreneurial drive and at least basic coding skills. Finding them is not easy.

Solution

The first step of creating a culture of data-driven conversion optimization in any organization is to educate the people about its benefits. Any enterprise planning to implement such a shift—moving from random A/B testing to scientific conversion optimization—must first understand the “why” behind it. That’s why we have 15 conversion rate experts share why they feel it is important to step up from A/B testing to conversion optimization.

Any cultural change requires the complete support of the top management. That’s why it is all the more important to convince it about conversion optimization. Here’s how you can use data to convince your top management about why they need conversion optimization:

  • Highlight improved user experience as a double win.
  • Present a competitive analysis.
  • Stress the gaps in your current approach.
  • Show the money.
  • Show the data.

Challenge 2. No Defined Structure that Supports CRO

It’s a huge challenge for enterprises to put together a structure that supports conversion optimization effectively. There are a number of questions that arise when addressing this challenge. Would it be beneficial to hire a dedicated conversion optimization team, or would it mean only additional expenditure? Who is responsible for conversion optimization?

With regard to this challenge, some interesting observations were listed by ConversionXL’s report on State of Conversion Optimization 2016. One of the findings quoted in the report mentions, “…only 29% of people said that there’s a single dedicated person who does optimization. 30% more said there’s a team in charge of optimization, but 41% of respondents had no one in particular that was accountable for optimization efforts.”

Some companies have internal conversion optimization teams that comprise an analyst, designer, marketer, and project manager. However, should these people invest all of their time on conversion optimization? One way of dealing with this is to have all team members allocate time between core job functions and conversion optimization.

Another challenge related to the lack of structured process to conversion optimization, as explained by Tim Ash, CEO of SiteTuners, and a digital marketing keynote speaker, is the isolation of the CRO team from the rest of the teams.

Tim Ash

The biggest problem that an enterprise CRO faces is the siloing emblematic of big companies. All job functions and even departments are compartmentalized and do not communicate well with each other. So even though a CRO group or team exists within the company, it is only able to focus on limited tactical objectives and simple split testing. Typically, CRO initiatives pass through compliance and approval reviews, get watered down by the branding gatekeepers, and then languish in the IT development queue to get implemented.

At SiteTuners, we have developed our Conversion Maturity Model to grade organizations on key aspects of their optimization effectiveness. Dimensions include culture and processes, organizational structure and skill set, measurement and accountability, the marketing technology stack, and of course the user experience across all channels.

One of the biggest determiners of success is whether there is active and consistent support for CRO from high-ranking executives. If there is political air-cover and the CRO team reports high up in the company, this team can work across the silos to tackle fundamental business issues involving products and services, the business model, back-end operational efficiencies, and fundamental user experience redesigns.

Solution

Lay down a clear process for conversion optimization that needs to be followed by everyone in the organization. Create a dashboard or platform where all the conversion optimization activities are planned, updated, and reported. Share this platform with everyone in the organization. Encourage a culture where everyone contributes to conversion optimization. However, make decisions based only on data. For example, while deciding what to test and optimize, follow a scientific hypotheses prioritization framework. The benefit—though everyone gets to share their observations and hypotheses—is that only the most relevant of those are tested.

Challenge 3. Inefficient Methodology to Implementing Conversion Optimization

Paul Rouke, Founder and CEO, PRWD points out that lack of user research is one problem in the current conversion optimization methodology followed by most enterprises.

Paul Rouke

Among enterprises, a lack of an intelligent and robust optimization methodology is a major barrier to them making experimentation a trusted and valued part of their growth strategy. Lack of user research in developing test hypotheses, alongside lack of innovative and strategic testing, instead a focus on simple A/B testing, are some of the biggest barriers which prevent enterprises from harnessing the potential strategic impact conversion optimization could have for their business.

As shown below, the interest in A/B testing is far more widespread than in conversion optimization.

interest in a/b testing vs. interest in conversion optimization - google trends
Google Trends

It is important to understand that testing random ideas based on opinions is not a smart way of testing. You may get a winning variation even by testing “ideas,” but this will not help solve the real pain points that users face. The challenge, therefore, is to eliminate guesswork; and the solution is to focus on data instead.

Here’s what Brian Massey has to say regarding eliminating guess work and relying on a behavioral data-based methodology.

Brian Massey

Enterprises are missing out on an area, that is, following Moore’s Law in terms of increasing capability and decreasing costs. Behavioral data collection is dropping precipitously in price, and new capabilities are coming online weekly. Just as Microsoft didn’t realize that mobile phone market would follow Moore’s Law, enterprises run the risk of missing the growth in Behavioral Science, a discipline designed to eliminate guessing from business strategy and tactics.

Mathilde Boyer, Head of CXO, House of Kaizen and Peter Figueredo, Founding Partner, House of Kaizen also talk about what is inefficient about the current conversion optimization methodology, as followed by some enterprises.

Mathilde Boyer

Opinion-based A/B testing is the gangrene of CRO programs. It hinders the process of objective creation and prioritization of test hypothesis. This tendency can lead to situations where a high level of resources are invested in low-impact optimization activities. Generation and prioritization of test hypothesis needs to be data-driven, systematic, repeatable, and teachable to allow for expansion of optimization activities across a business.

Peter Figueredo

Companies who invest in CRO typically rush to get testing started and overlook the importance of conducting research. Without proper research for informed testing, the design process CXO has lower chances of success. If your doctors do not know the root cause of your ailment, then they are likely only treating the symptoms but not curing the disease. Research should never be ignored and should be a critical component of House of Kaizen’s CXO success.

Solution

Data-driven optimization is focused on identifying friction, understanding the why behind user behavior, and testing hypotheses based on that data/information. Here’s what a formalized conversion optimization methodology would comprise:

  1. Researching into the existing data
  2. Finding gaps in the conversion funnel
  3. Planning and developing testable hypotheses
  4. Creating test variations and executing those tests
  5. Analyzing the tests and using the analysis in subsequent tests

You can read more about the scientific methodology for conversion optimization in this post.

Andre Morys, CEO of Web Arts,  in one of his interviews, talks about what’s wrong with the methodology. According to him, 80–90% of big companies do not aim for bigger goals, which could be change in the growth rate. This is another methodology-related drawback, as the goals being set do not take the profitability into account. Andre’s interview answers many other questions related to business growth.

Challenge 4. Choosing the Right Tool to Meet the Business Goals

The decision-makers in an organization have a variety of tools to choose from for meeting their business goals.  For example, when deciding on an A/B testing tool, they have to make a choice between a:

  • Frequentist-based statistical engine
  • Bayesian statistical engine

Moreover, there are multiple tools that help accomplish specific objectives. Enterprises might use hotjar for heatmap reports, a/b testing from VWO, and some other tool for on-page surveys. Reporting becomes a pain when instead of using one connected platform, enterprises use multiple tools to execute their conversion optimization program. If enterprises instead switch to a single connected platform, they can save a lot of time and resources.

Another problem with not using a single tool for testing and optimization is that it becomes difficult to explain instances of success and failure to the top management. This could be confusing for managers who are not in touch with day-to-day implementation of the conversion optimization program.

Solution

For selecting the correct tool, decision-makers need to weigh the pros and cons of their actions. They need to evaluate the tool based on how effectively and efficiently it can solve their specific business problems. For enterprises looking to invest in a tool for business growth, here’s a post on what decision-makers need to know before investing in CRO or A/B testing software.

Challenge 5. Insufficient and Incorrect Budget Allocation

Back in 2013, most companies spent less than 5% on conversion optimization from their total marketing budget.

budget for conversion optimization - graph

Moving on to 2014, a report from Adobe says that top-converting companies spend more than 5% of their budgets on optimization. Per the conversion optimization report 2016 by ConversionXL, businesses have increased their spend on optimization. The problem, however, lies in correct allocation.

Paul Rouke talks about inefficient budget allocation as follows:

Paul Rouke

Budgets for conversion optimization within enterprises are continuing to increase, but typically in the wrong direction. Enterprises focus far too much of their marketing investment in enterprise technology. As a result, there’s little investment in people and their skills to actually harness the technology—whether building their in-house team or harnessing specialist agencies.

Enterprises which invest in Human Intelligence (HI), above and beyond technology, and AI are the ones who are positioning themselves for significant and sustainable growth. Growth is about people.

Solution

Before deciding the amount that enterprises should spend on conversion optimization, they should think about the return on investment from CRO. Organizations need to budget for the conversion optimization tool while analyzing their goals and actual gains. To read more on how to budget for conversion optimization, read this post by Formstack.

Summary 

Although the interest in conversion optimization is growing, due to certain challenges, it is not being adopted fully by enterprises. Some of the drawbacks that this post talks about are related to organizational culture, structure, methods and processes, tools for conversion optimization, and budget. These challenges are either related to adoption of conversion optimization or its smooth implementation. Solving these can help enterprises deploy conversion optimization efficiently and effectively to achieve growth and success.

Hope you found this post insightful. We’d love to hear your thoughts on challenges that enterprises face when implementing conversion optimization. Send in your feedback and views in the comments section below.

Approach_Increasing_Conversion_Rates_Free_Trial


The post 5 Conversion Rate Optimization Challenges For Enterprises To Solve appeared first on VWO Blog.

Read original article: 

5 Conversion Rate Optimization Challenges For Enterprises To Solve

The 4-Hour Website Optimization Challenge: What Would the Experts Do?

4-hour-challenge-blog
You’re being lowered into a pit of anacondas over four hours, and only a lift of 0.01% or more could stop it — best get optimizing! Image by Viktor Hanacek via picjumbo.

As marketers, the clock always seems to be against us.

So when it comes to conversion optimization, most of us simply don’t have enough hours in the day to plan and execute a proper strategy — even if we do have the necessary skills and resources in place.

This led our team to a simple question: Is it possible to generate a sustainable lift for a website in just a few hours?

We each had our own opinions, but to dig deeper we reached out to five colorful characters in the CRO space — Brian MasseyAngie SchottmullerPeep LajaNeil Patel and Unbounce’s own Michael Aagaard — and asked them a simple question:

“If you could spend only four hours optimizing the marketing performance of a website, what would you do?”

The criteria

First, I must get this out of the way: There’s no such thing as a “get conversion-rich fast” approach.

Conversion optimization (CRO) is synonymous with continuous improvement, and with a few exceptions, simple changes won’t drive long-term results.

And further, mastering CRO takes time and a wide range of skill sets: analytics, marketing, user understanding, user experience, design, copywriting, development and project management.

So when I talk about having four hours to optimize a site, I’m not implying that a site could be fully optimized after a four-hour period. Rather, we wanted to know how our experts could demonstrate the power of optimization in a short period of time.

Will going to the gym five times get you into shape? No. But if you saw results after 5 sessions, would it inspire you to keep going? Yes.

And that’s the purpose of this post — to help marketers get their feet wet in CRO, so they can get excited about the awesome potential it holds.

So here we go!

1. Brian Massey: “Try a headline test.”

Brian Massey

Brian Massey is the founder of Conversion Sciences, a company that helps clients improve revenue and leads from existing traffic.

Brian is a regular speaker at corporate events, universities and conferences worldwide, and is the author of Your Customer Creation Equation: Unexpected Website Formulas of The Conversion Scientist.

When I first asked Brian the question, here’s what he told me:

If I had only four hours to optimize a website, I would spend five minutes making myself a coffee, then three hours and 55 minutes looking for another job. Optimization doesn’t happen in four hours.

Ouch, not a good start. But I took his advice, and spent four hours applying for “management” positions at Best Buy and Enterprise Rent-a-Car.

No dice.

I pressed Brian, and asked him to imagine he was being lowered into a pit of anacondas over four hours — and only a lift of 0.01% or more could stop it — surely there’s something he could do?

He relented, and offered me this:

Here are some ideas of what I could do in the four hours: Write 25 headlines for each of my landing pages. Pick the best for each and make the change. Setup Google Analytics and CrazyEgg on my site. Create some awesome, relevant content. Take a course in Web analytics. Spend four hours reviewing my ad campaigns to ensure I’m getting quality traffic. Collect the resumes of professional copywriters and hire one.

He then offered a strategy that involved breaking up the four hours.

Hour 1: Write 25 headlines for your best performing landing page and pick four that are very different from each other.

Hour 2: Create four pages (or four page variants), one with each headline.

Hour 3: Setup Unbounce, Optimzely, Visual Website Optimizer or Convert.com to send a quarter of the traffic to each. Up all of your ad spends to ensure you get several thousand visits over a week or two.

Wait at least one week, until the test reaches statistical significance.

Hour 4:  If there’s a winner, make the change permanent.


“If I had only 4 hrs for #CRO, I’d create and test 4 pages with different headlines.” ~@bmassey
Click To Tweet


Our take

Content matters more than anything else, and within the broad content sphere, headlines and value propositions are the heaviest hitters.

Brian’s approach is perfect for time-starved marketers seeking CRO results, because it gets straight to the point: Testing how users react to changes in your value proposition.

If you perform A/B tests on your value proposition, I can almost guarantee your conversion rate will change. It may go down, but failed tests provide almost as much insight as winning tests.

2. Peep Laja: “Tackle pages with the biggest drop-off.”

Peep

Peep Laja is the founder ConversionXL — one of the most popular (and respected) online marketing blogs on the web. He’s a popular speaker on the CRO circuit, and if you happened to catch his presentation at CTAConf 2014 in Vancouver, you know he tells it like it is.

When I asked Peep how he would spend his four hours, he responded in less than five minutes:

I would check Google Analytics to find where the biggest drop-offs are happening and would focus all my efforts on those pages. Heuristic analysis would reveal a bunch of insights, and this combined with some user tests via Usertesting.com would give some validation to my experience-based assessment findings. All of these things would be doable within a couple hours.


If @PeepLaja had just 4 hrs for #CRO? “I’d tackle pages with the biggest drop-off.”
Click To Tweet


Our take

We like Peep’s approach because it mixes instinct (developed from years of work in CRO) with qualitative data.

Google Analytics is still the best tool for finding actionable data that sets you on the path toward a successful treatment.

Thanks for the insight, Peep!

3. Angie Schottmuller: “Interview your customers.”

Angie

Angie Schottmuller is a growth marketing consultant, author and speaker. She was recently named one of Forbes’ top 10 online marketers to follow in 2015 — so she’s no stranger to CRO.

I first met Angie at CTA Conference 2014 in Vancouver, where she gave an incredibly informative and entertaining presentation called “Optimizing Persuasion with Buyer Modalities.”

When I asked Angie how she would optimize a site in four hours, here’s what she said:

I would use an hour or two to better understand the audience. That means interviewing actual customers or prospects to learn why they DO and why they DON’T buy. Talk with customer service or sales reps at the “business front lines” for insights as well. Review the feedback to surface top recurring questions, concerns, interests or objections. Score hypothesis opportunities using the PIE framework. (I adapt this model to PIER — where “R” measures reusability of the learned insight.) Then use the remaining time to implement a fix or A/B test for the top scoring hypothesis from opportunities the audience specifically called out.

Video via WiderFunnel.

A rapid fire four-hour fix isn’t quite practical. However, nothing is more practical than going direct to the source — the customer — for some actionable qualitative feedback. The underlying objective of conversion optimization is to learn more about the customer: preferences, pain points and interests. The more you understand about the customer and how you can assist achieving their goal, the more likely you’ll be to achieve your own.


“In #CRO, nothing’s more practical than asking customers for actionable feedback.” ~@aschottmuller
Click To Tweet


Our take

We love how Angie dives straight into a very important — yet often overlooked — aspect of conversion optimization: Understanding your customers.

All high-converting websites do one thing really well and that is answering the customer’s questions. But without interviews, we’re left to guess what those questions are.

Altering your site copy to address the questions of your customers is one of the simplest, least expensive and quickest conversion-focused changes you can make to a web page or landing page.

4. Michael Aagaard: “Focus on heuristic analysis.”

Aagaard

Self-confessed “split-test junkie” Michael Aagaard lives and breathes conversion. He’s spent the past several years conducting hundreds of copy-based A/B tests, which he shares in the many interesting case studies on ContentVerve.

Michael recently joined Unbounce as its Senior Conversion Rate Optimizer (catch him live at CTAConf 2016!).

So how would Michael optimize a website in four hours?

If I had four hours to optimize a website, I’d spend one hour digging through analytics data to identify areas that represent the biggest potential lift. Then I’d spend an hour conducting a heuristic analysis. After that, I’d spend 30 minutes coming up with an optimization hypotheses. Finally, I’d spend the last hour and a half actually creating the treatment.


#CRO in just 4 hrs? “Check Analytics for areas with the biggest potential lift.” ~@ContentVerve
Click To Tweet


Our take

Europeans always stick together, don’t they?! Michael echoes Peep’s sentiments by zeroing in on areas with the greatest potential lift.

Michael’s approach shows that even if you’re experienced in the CRO space, you still must test your assumptions. With time and experience, your “gut” will become more reliable in making assumptions, but will never give you a definitive answer without testing.

5. Neil Patel: “Focus on your tags.”

Neil

Neil Patel runs the well-known blog Quicksprout, and is the co-founder of both KISSmetrics and Crazy Egg. He’s a major influencer in all things online marketing.

Neil answered the question a bit differently than our other experts, instead choosing to focus on SEO and page performance. Here’s what he told us:

If I had only four hours, I would go through Webmaster Tools and fix any of the basic errors that they are showing. This would include crawling errors, 404 pages and even duplicate title tags or meta description tags. Sure these things seem small, but fixing them will help you generate more search traffic in the long run.

Next, he delved into performance.

In addition to that I would set up Google Pagespeed. One major reason websites don’t convert well is because they load slow. By using Google Pagespeed, you can improve your load speed, which should help increase your overall traffic and conversion rates.


“If I had just 4 hrs for #CRO, I’d fix crawling errors, 404s and duplicate title tags.” ~@neilpatel
Click To Tweet


Our take

Neil gets right to the heart of an issue marketers often neglect. If your site is slow, or people can’t find it, it doesn’t matter how well you’ve optimized the on-page experience. Optimization should be about the bottom line, and sometimes you can get a tremendous ROI from looking at broader infrastructure or visibility factors.

Takeaways

A common thread throughout all our experts’ answers is the need to focus on changes that actually make a difference to your overall bottom line. When you only have four hours, you don’t have time to test low-impact hypotheses.

There are several simple and fast techniques to identify where you can get a large ROI. The right one for you will depend on what you have immediate access to.

If you can, start by talking to your customers. If that’s not an option right now, dive into Google Analytics and understand where people are exiting and if there are any slow pages.

Finally, you can’t go wrong testing vastly different headlines and value propositions. After all, conversion optimization is really about the art and science of communication, and your words matter.

So, if you had just four hours to optimize a website, what would you do? Drop us a comment.

And once again, many thanks to Brian, Peep, Angie, Michael and Neil for participating in this post.

Read this article – 

The 4-Hour Website Optimization Challenge: What Would the Experts Do?

Why Your AdWords Competitors Are Making More Money Than You

frog
Don’t go green with envy over the success of your competitors’ Adwords campaigns. Photo via Kaboompics.

I know, that’s a pretty harsh headline. But it’s true.

Some of your AdWords competitors are making more money than you.

Whether you’re trying to generate leads, get new SaaS users or make ecommerce sales, there’s an AdWords competitor out there who’s able to spend more than you to acquire new business while also making more money at the same time.

But here’s the good news: You can get much more from your modestly sized budget if you’re willing to look at things a little differently.

Let’s take a look at the four biggest things you need to change:

  1. You complain about lead quality, but haven’t adapted your offerings
  2. You’re obsessed with your conversion rates, but not your sales rates
  3. You’re getting conversions, but your sales game is weak
  4. You’re getting sales, but you’ve never tried increasing your prices or upselling

Let’s dig in.

1. You complain about lead quality, but haven’t adapted your offerings

If you have an AdWords campaign that’s serving you well, you may be tempted to pump more money into it.

But don’t assume that more traffic = more conversions.

Your AdWords traffic is composed of a colorful bunch of people with a different set of needs and dramatically different budgets.

There’s nothing you can do to change that.

All you can do is adapt your offerings.

Consider how Google has three different products to choose from when it comes to PPC:

adwords options
Which one are you using?
  • Small mom-and-pop shops may get by with Google AdWords Express where not a lot of customization is needed.
  • Smaller to medium sized businesses might have all their needs met with regular Google AdWords with ad scheduling and keyword targeting.
  • Enterprise level companies might only want to use DoubleClick because of the additional abilities like bidding separately for tablets or access to other ad networks beyond regular Google Search and Display.

With our PPC and landing page agency, KlientBoost, we know we don’t want to work with every single lead that comes through our door. We only want to work with companies that fit our requirements (like a certain amount of ad spend per month).

And in the beginning of our agency journey, we were throwing a ton of leads away since all we cared about was signing up people for our month-to-month services, our biggest bread winner.

I felt like Captain Ahab chasing around a bunch of Moby Dicks.

Captain Ahab
Costa Mesa, CA — that’s where our boat is docked, and our office.

But we all know that whale hunting is ridiculously tough on the shoulders (and illegal). Plus there are way more sardines than whales in the ocean.

So how could we profit off those sardines smaller fish?

Since our lead volume kept growing from our marketing efforts, I had to do something different to take advantage of those fish.

So I started experimenting.

What if the people who can’t afford to work with us on a monthly basis could still get help from us?

With that “Aha!” moment, we introduced one-time growth packages where we helped clients set up their AdWords account and landing pages, and then handed them the keys to run it.

We didn’t create new ads, landing pages or change anything in our PPC accounts. Because someone searching “PPC agency” could have a budget of a $1 million a month or just $100 a month.

Fast forward two months and we’ve made $32,500 from that one decision change. Money we’d otherwise have missed out on.

And these new packages then give us the opportunity to potentially work with those customers on a larger scale when they can afford our month-to-month services.

stripe
Here’s a quick look at our Stripe history with some of those recent charges. Not bad if you ask me!

So even if you get conversions from people who are ready to buy, but can’t afford your solution, what are you doing to get their foot in the door?

Have you considered offering them something of complementary value to your core offering?

2. You’re obsessed with your conversion rates, but not your sales rates

If you are doing a good enough job getting AdWords traffic, then trust me, it’s not the quantity of the conversion you should be worried about, it’s the quality of those conversions.

You’ll want to make sure you track and qualify your conversions fast enough to understand if they’re worth spending time on (especially if you’re trying to generate leads).

Let’s use LeBron James as an example. On the surface, some AdWords keywords and display placements could be looking like a superfly LeBron James in a golden leotard with fancy dance moves (getting a ton of leads), but on the back-end, they’re not getting you enough championships (a.k.a. sales).

LaBron James
Don’t be fooled by the pants and fancy dance moves. Image via Giphy.

What your competitors already know is to track the entire process from click to close (first AdWords click to you actually making money) and optimize off of sales, not leads.

If you’re trying to generate leads, your competitors might already know which keywords have the highest sales rates (from paying over the phone), not just conversion rates (from converting on the landing page).

And that’s where your competitors are laughing all the way to the bank.

The flashiness of leads (and golden leotards) inside your AdWords account has you focused on getting more, without realizing that you could cut your budget in half and still get the same amount of sales.

But how do you do that?

The secret is called ValueTrack parameters, and it’s a URL parameter string you can append to your final URLs inside the tracking template field of your AdWords account.

ad builder
The “Ad URL options” field is where you want to add those parameters.

You can custom create your own URL parameter string or adopt what I recommend below:

lpurl?GA_network=network&GA_device=device&GA_campaign=campaignid&GA_adgroup=adgroupid&GA_target=target&GA_placement=placement&GA_creative=creative&GA_extension=feeditemid&GA_keyword=keyword&GA_loc_physical_ms=loc_physical_ms&GA_landingpage=lpurl

Next, you’ll want to make sure your landing page form has the hidden fields (like GA_network, GA_device, etc.) to capture that info along with the form fields the visitor is filling out.

This URL parameter string that you add to your AdWords ads will help you see which networks, devices, keywords, campaigns, etc. that your conversion came from and how much money that conversion meant for you.

hidden field data
Here’s what that hidden field data looks like inside Unbounce.

In the world of lead generation, let’s break this down with a hypothetical example:

Keyword #1 = 20% lead conversion rate and a 10% sales rate

Keyword #2 = 10% lead conversion rate and a 50% sales rate

If you were only tracking lead conversion rates, then you’d think keyword #1 is performing better because of the higher conversion rates and lower cost per conversion.

But if you do the math, it’s keyword #2 that’s making you more money.

Keyword #1 = 1 lead for every 5 clicks (20% conversion rate), 1 sale for every 10 conversions (10% sales rate). 50 clicks = 1 sale.

Keyword #2 = 1 lead for every 10 clicks (10% conversion rate), 1 sale for every 2 conversions (50% close rate). 20 clicks = 1 sale.

As you can see, not tracking the quality of your conversions can be detrimental.

Even without a fancy CRM, you can quickly backtrack and see which areas in your AdWords account are bleeding money. Better yet, increase bids on the keywords and placements that are giving you high quality conversions to get more of them.

3. You’re getting conversions, but your sales game is weak

Did you know that it takes on average between five and 12 touches of following up with a prospect before you close them?

But I’m not talking about manually spending more time emailing or calling prospects.

Because how many times have you complained about not being able to get a hold of your form leads?

Let me guess — quite a bit.

What you do after they convert matters just as much as what you did before they converted.

If your AdWords competitors are smart (and I know some of them are), then they already have an email nurturing program in place to drip value on their leads.

baby chimp
You know, to keep their prospects engaged, fed and happy.

And while some of your competitors may be bigger than you and have more money, there’s absolutely no reason why you can’t do the same.

For our PPC agency, here’s what our workflow looks like when we’re trying to give someone a custom proposal:

Email 1 What our proposal looks like
Email 2 AdWords screenshots of ongoing monthly improvements
Email 3 Monthly service or one-time package
Email 4 Custom goal setting ideas (scale or get lean)
Email 5 Links to our partner webinars
Email 6 Podcast/interview links (showing thought leadership)
Email 7 Case studies from current clients
Email 8 Call to action of getting a proposal
Email 9 New AdWords screenshots of improvements

The goal of each email is to showcase our skills and the features and benefits we can bring to prospects and their business.

We were super impressed with the continuous open rates (50% average throughout the entire sequence), but even more blown away to see that leads we’ve never heard from initially didn’t reply to us until they got the sixth email (out of nine total).

Which, funny enough, is a link to the podcast I did with the peeps here at Unbounce

email campaign
Here’s a snapshot of our first four drip emails.

So if you’re spending precious dollars on AdWords, how are you making sure that none of your conversions are going to waste?

If you think you can afford to have a “lead nurturing program” that’s made up of only two phone calls and one email, then you’re wasting your time and money.

Because it takes much more effort these days to to turn a conversion into a sale, you need to equip yourself with the tools that sales professionals use on a daily basis.

Here are a few to help you out:

MailChimp

MailChimp is one of the easiest email automation tools out there.

If you can map out five emails that would bring value to your prospects, then turn them into a MailChimp automation workflow.

The goal of MailChimp will be to get your prospects to take a specific action. In our case, it’s a simple response that they want a proposal from us. When that happens, we move them over to Yesware.

Yesware

Yesware is a Gmail tool that helps you track email opens and gives you the ability to automatically remind yourself to follow up with leads after a certain period of time.

Once someone has replied to us via MailChimp, we put them in Yesware as they’ve now moved into our sales funnel.

Yesware helps us track who opens our emails and reminds us to follow up with prospects too.

Autopilot for LinkedIn

Autopilot is a cool tool that allows you to “autovisit” the LinkedIn profiles of your prospects. You set the criteria and the tool will notify your prospects that you visited their profile.

For us, this acts as great touch points without having to manually visit profiles every day and helps us look like we’re everywhere when someone is considering working with us.

IFTTT

IFTTT stands for “if this, then that,” and it allows you to automate some of your lead nurturing touch points.

Let’s say someone comes through as a lead on your landing page. You can then use IFTTT to connect with them on Twitter and LinkedIn (if the emails match) with a certain amount of time delay.

This will make you look like you’re going the extra mile compared to some of your competitors (who your lead could be talking to) to really want to work with the lead.

But don’t take my word for it.

I spoke with Sujan Patel from ContentMarketer.io who gave me a new perspective on the focus of nurturing:

When someone decides to become a lead it means they’ve decided to “explore” or find out more, not purchase (you made a good first impression). Lead nurturing keeps you top of mind (or close to it), builds credibility, trust and helps you passively demonstrate your value.

The same thing applies to AdWords traffic.

If someone finds you via PPC, then they also know they have 10 other options (the 10 others search ads on Google) that they need to explore and will most likely compare all the options.

If you’re fortunate enough to get a conversion, then you must strongly consider the nurturing part as well. Because sometimes, there’s a big gap between getting a conversion and actually making money.

4. You’re getting sales, but you’ve never tried increasing your prices or upselling

I remember my first PPC client.

I just got back from a pitch at a local crossfit gym in Newport Beach and I recall how nervous I was that I nearly sputtered out my price when they asked.

“Uhmm… That would be uhh… $250 a month for everything we talked about, which includes keyword bidding, ad testing uhmmm… negative keywords…”

I felt like I had to defend myself, even though they were clearly interested.

Right after the meeting, I went straight home to my bed and fell asleep because I was so emotionally drained.

Then — to my surprise — when I woke up, I had a PayPal notification showing that they’d paid.

Since then, we’ve increased our average price to be almost twenty times what it was back then.

And it isn’t because we’re trying to keep up with the rate of inflation.

It’s because we know, just like your competitors know, that if our profit margins are high enough, then

  • we can spend more money to acquire a client,
  • we can be okay saying no to more of the smaller fish
  • and we’ll have more time to work on the results for our Moby Dick clients so that we can retain them longer and make more money.

Now I know that raising prices can be a scary thing, especially when you might alienate people who aren’t willing to pay what you ask.

But consider the obvious negotiation tactic of starting high and then going low.

You’ll be surprised how many people are okay to pay what you charge, even if you double your pricing on your next sales call.

And when you do, don’t stop there. Be a greedy pig goat.

baby goat

Because as soon as you have a customer that’s already paying, they’re 50% more likely to buy again compared to brand new prospects.

Another tactic to consider is the upsell. GoDaddy gets aggressive with its upsell, even before you’ve bought anything:

godaddy upsell
Sure, I’ll take .net, .org and .info.

So when it comes to paying a decent amount of money for all your AdWords clicks, strongly consider what you can do increase your prices without increasing your resources.

So what’s next?

Now that you’ve been spending the last couple months improving your AdWords metrics and landing page conversion rates, I hope you have a stronger incentive to learn about the other improvements you could be making (both during and after conversions).

In the long run, the changes above will improve your bottom line from other marketing efforts. It won’t be long until you can’t even see your AdWords competition in the rearview mirror.


Read the article: 

Why Your AdWords Competitors Are Making More Money Than You

Thumbnail

Putting Mobile Back End As A Service Into Practice (Part 1)

In a previous article1 I introduced mobile back end as a service (MBaaS) which aims at giving app developers the ability to create seamlessly new feature-complete cross-platform native and web applications.

The next step is implementing a complete demo application using those ideas. Through this real working application, you will be able to see the areas in which MBaaS provides value. This first part will walk you through a messaging application demo powered by the Kinvey application and explore how to leverage user management, file storage and the data store.

The second part will complete the demo and demonstrate how to leverage two key pieces of Kinvey functionality: the permissions provided by the data store, and push notifications, which are enabled through the business logic functionality.

Setting Up

Before jumping into the demo application, I want to highlight a few points. First, because I am using a real app to discuss MBaaS, knowledge of the development platform would be extremely helpful. I am leveraging iOS with Swift. In addition, knowing how to integrate with back-end services would certainly be helpful, in order to understand more about what Kinvey is doing under the hood. While all of this is helpful, the application’s full source is included; feel free to analyze the code at your own pace.

Secondly, because the demo application has more of an enterprise focus (as opposed to a consumer focus), I chose Kinvey2 for the MBaaS platform. In the last article3 I walked through the process of evaluating MBaaS providers. Note that Kinvey is not a free service, and licensing terms are attached to its SDKs (as one would expect). Licensing terms are included with each SDK download. You can get more information at the following links:

A Demo Application

In the past three years, several clients have approached me about developing an internal messaging platform for their organization. This need has led to the success of such companies as Slack6 (which we use internally at Universal Mind7) and others like it. Because this was a common request, I wanted to see what it would take to implement a basic one-to-one messaging solution for an organization over top of an MBaaS solution.

To help you understand these concepts in a real application, I have provided the application’s entire source code. You can check it out on Github, “WaterCooler Demo8.”

Note: For more information on how to choose between the available MBaaS options, please see the initial article in this series, “Understanding Mobile Back End as a Service9.”

Screenshots of WaterCooler app10
WaterCooler demo messaging app. (View large version11)

Summary of Requirements

To illustrate how an MBaaS solution can power an app like this one, we need to meet a few key requirements. Users should be able to do the following with the app:

  • create an account and set up their profile (including name, title, profile picture, email address and password);
  • log in (and be required to log in only once — at least until they log out);
  • exchange one-to-one messages with other members (visible only to the sender and recipient and inaccessible to other users);
  • browse a directory of members who currently have an account on the platform;
  • log out;
  • manage and update their profile information;
  • be alerted through a push notification that they’ve received a new message.

The following sections detail how I used Kinvey to meet these requirements. While I won’t go into detail on how every part of the application was created, I will give full context of the areas where Kinvey was leveraged.

Technical Details

The demo application is an iOS app targeting iOS 8+. It utilizes Swift (Xcode 6.1.1 and iOS 8.1.3).

The user interface was created following standard UI principles for iOS. It leverages Auto Layout12 (both within the storyboard and programmatically). The creation of this interface is beyond the scope of the article, but hopefully the example code will be helpful for your iOS applications.

Getting Started With Kinvey

If you’re following along, you’ll probably want to build the source code and run the application yourself. To do this, you will need both to create a Kinvey app and to include the credentials for the app in your code.

Creating a Kinvey App and Environment

To create a Kinvey app and environment, you will need to create a Kinvey account13. After signing up, select “Get Started with Your First App.” From this page, give your app a name, select iOS and the platform, and then click “Create App.”

Screenshot of creating an app in Kinvey14
A view of the process of creating an app in Kinvey. (View large version15)

From here, you will have an app created with a single development environment. Clicking on the “Development” environment will take you to the console. In the console, you will see both your appKey and appSecret in the top right. Copy these pieces of information because you’ll need to include them in the iOS app.

Configuring the iOS Application

Once you have created your Kinvey app and gathered your credentials, grab the code from the repository. Next, open the AppDelegate.swift file and update these values in the application:DidFinishLaunchingWithOptions: method.

// Extracted from AppDelegate.swift (http://tuck.cc/1w7wkyI)

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool 

 // --------------------------------------------------------------------
 // INCLUDE YOUR KINVEY CREDENTIALS HERE
 // --------------------------------------------------------------------

 let appKey = ""
 let appSecret = ""

 //---------------------------------------------------------------------

 …

Once this is in place, you should be able to run the application as expected. If you want to run the application on a device, you will have to update the code signing as provisioning profiles (as with any iOS application).

  • For more information on setting up an iOS application with Kinvey, check out the “Getting Started16” tutorial.

User Management

One foundational element of any MBaaS is user management. This application will leverage user management to control individual user accounts and their respective profile information, as well as provide a directory of all users in the system. Just as with the rest of the functionality we will cover, this integration is provided through Kinvey’s iOS SDK17.

Sign-up, log-in and profile views18
A view of the sign-up, log-in and profile views in the application. (View large version19)

Creating a User

The first step in the process is to enable a user to create an account. When a user launches the application, they will land on the view that allows them to either log in or sign up. If the user selects “Sign Up,” they will be taken to the “Sign Up” page, which will guide them through the process of entering their profile information. When this process is complete, the code below is executed, which creates an account and logs the user into the application.

In this example, you will see the KCSUser class. This class handles the representation of a user and is also the gateway for all operations related to user management:

// Extracted from SignupViewController.swift (http://tuck.cc/1vsaWcr)

// Set the parameters of the user
var userParams = [
 KCSUserAttributeGivenname : firstNameField.text,
 KCSUserAttributeSurname : lastNameField.text,
 KCSUserAttributeEmail : emailField.text,
 kWaterCoolerUserTitleValue : titleField.text
];

// Save the user to Kinvey
KCSUser.userWithUsername(emailField.text, password: passwordField.text, fieldsAndValues: userParams)  (user:KCSUser!, error:NSError!, result:KCSUserActionResult) in
 if(error != nil) 
 println("USER NOT CREATED - ERROR: " + error.description)
  else 
 // User created successfully
 // Do other tasks, such as uploading profile picture to the file store
 
}

In this case, the fields for first name, last name and email address are include in the KCSUser object. However, Kinvey allows us to save other pieces of data in this object as well. The user’s title will be saved in one of these additional fields. An extension to the KCSUser object is also included (as seen below) to make it easier to access this value for a user within the application:

// Extracted from KinveyExtensions.swift (http://tuck.cc/1vsb5N7)

// Create a constant for accessing the title key from the user object
let kWaterCoolerUserTitleValue = "title"

extension KCSUser 
 var title:String 
 return self.getValueForAttribute(kWaterCoolerUserTitleValue) as String!
 
}

Logging In

If the user selects the option to log in from the landing page, they will be able to enter their email address and password (which they entered in the sign-up process). They are presented with an alert if their attempt is unsuccessful, and if they log in correctly, they are redirected to the main view of the application.

// Extracted from LandingPageViewController.swift (http://tuck.cc/1vsbeAe)

func attemptLogin() 
 // Get the values from the form
 let username = loginEmailField.text
 let password = loginPasswordField.text

 // Attempt to log in to the application
 KCSUser.loginWithUsername(username, password: password)  (user, error, actionResult) -> Void in
 if(error == nil) 
 self.successfulLogin()
  else 
 self.incorrectLoginWithError(error)
 
 }
}

func incorrectLoginWithError(error:NSError) 
 // Let the user know an error occurred in login. In this case
 // we just present an alert using the UIAlertController.
 let alert = UIAlertController(title: "Failed Login", message: error.localizedDescription, preferredStyle: UIAlertControllerStyle.Alert)
 alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Cancel, handler:  (alertAction) -> Void in
 self.dismissViewControllerAnimated(true, completion:nil)
 ))

 // Present the alert
 presentViewController(alert, animated: true, completion: nil)
}

func successfulLogin() 
 // There is already a segue defined to the main threads view.
 // We need to perform this segue if we have a successful login.
 performSegueWithIdentifier(WaterCoolerConstants.Segue.Login, sender: self)

Logging Out

From the profile management page, the user can log out of the application. Upon doing this, Kinvey’s iOS SDK also does some additional work in the background, including clearing out any cached values. In this example, after logging out, the user is redirected back to the landing page.

// Perform the log-out and send the user to landing page
@IBAction func logout() 
 KCSUser.activeUser().logout()
 performSegueWithIdentifier(WaterCoolerConstants.Segue.Logout, sender: self)

User Directory

To fulfill all of our requirements, the application also needs to provide a list of all users. A special collection, KCSCollection.userCollection(), provides access to the collection of users for an application. Once you have created a store from this collection, you can query it as you would any other data collection. The following example illustrates how to fetch all users for the application:

// Extracted from KinveyDataManager.swift (http://tuck.cc/1vsd0Bp)

// Create the app data store corresponding to the users collection
lazy var userStore:KCSAppdataStore = 
 let userCollection:KCSCollection = KCSCollection.userCollection()
 let store = KCSAppdataStore(collection: userCollection, options: nil)
 return store
()

// Fetch the users from the user store
func fetchUsers(completion: ([KCSUser]!, NSError!) -> ()) 
 userStore.queryWithQuery(KCSQuery(), withCompletionBlock:  (results, error) -> Void in
 if(error == nil) 
 self.users = results as [KCSUser]
 completion(results as [KCSUser]!, nil)
  else 
 completion(nil, error)
 
 }, withProgressBlock: nil)
}

Note: For more information on managing users with Kinvey’s iOS SDK, be sure to check out the “Users20” guide.

File Management

One powerful feature of many MBaaS solutions is file storage. In our WaterCooler application, this comes into play when a user creates an account and adds a profile picture. We could also leverage this heavily to extend the app to support the uploading of images within messages. In this process, the file is uploaded to a content delivery network (CDN) and, like any other piece of data, has a full configuration of permissions.

// Extracted from SignupViewController.swift (http://tuck.cc/1vsaWcr)

// Upload the profile picture to the Kinvey file store
func uploadProfilePicture(completion:(file:KCSFile!) -> ()) 
 if((self.photo.image) != nil) 
 let photoData = UIImageJPEGRepresentation(self.photo.image, 1.0)

 KCSFileStore.uploadData(photoData, options: fileParams, completionBlock:  (file:KCSFile!, error:NSError!) -> Void in
 completion(file: file);
 , progressBlock: nil);

 } else 
 completion(file: nil);
 
}

// Once we have completed the file upload, assign the file ID to the user
// using a custom attribute
func assignProfilePictureIdToUser(user:KCSUser, picture:KCSFile, completion: () -> Void) 
 user.setValue(picture.kinveyObjectId(), forAttribute: kWaterCoolerUserProfilePicFileId);
 user.saveWithCompletionBlock  (user:[AnyObject]!, error:NSError!) -> Void in
 completion();
 
}

In the code above, two distinct steps are occurring. First, we are uploading the profile picture to the file store. Once this process is completed, we are updating the user with the ID that the file store has returned. In this manner, we are leveraging yet another custom property on the user to store an identifying piece of information. Now, anywhere we display a list of users, we can also display their profile picture.

Note: For more information on working with files in Kinvey’s iOS SDK, see the “Files21” guide.

Data Model

One of the benefits of Kinvey’s iOS SDK is that it allows you to map your Swift (or Objective-C) objects to Kinvey collection objects. The KCSUser class is a special class that is already defined and mapped to the user object, but in our case we will create two additional data classes that map to conversations and the messages within them.

WaterCooler Data Model

The WaterCooler data model will have two main entities, Message and MessageThread.

The MessageThread class will be responsible for representing a conversation between two users. It will contain information about the users involved in the conversation, as well as a reference to the last message sent in the conversation.

Within Kinvey, the entityId is a special field. If you do not assign a value to it, the system will assign one when the object is saved to the data store. In our case, we will go ahead and define a special value that maps to the two users who are in a conversation for the MessageThread class. The method that calculates this value can be seen below:

// Extracted from MessageThread.swift (http://tuck.cc/1w7jdOd)

// This method simply takes a user and the current user and creates
// an ID based on the alphabetized array of user IDs between these
// two users. In this way, we don't have to fetch additional information
// when displaying the message thread view.
class func threadIdentifierForUser(user:KCSUser) -> String 
 let userAIdentifier:String = KCSUser.activeUser().userId
 let userBIdentifier:String = user.userId
 let identifiers:[String] = [ userAIdentifier, userBIdentifier ]
 let sortedIdentifiers = identifiers.sorted 
 $0.localizedCaseInsensitiveCompare($1) == NSComparisonResult.OrderedAscending
 
 return ":".join(sortedIdentifiers)
}

The Message class will be responsible for tracking an individual message within an overall conversation. This class contains information about the message, including its time, contents, sender and related message thread. To get all of the messages for a particular conversation, we simply query based on the threadId of the conversation. The following code fetches all of the messages for a predefined message thread:

// Extracted from KinveyDataManager.swift (http://tuck.cc/1vsd0Bp)

func messagesForThread(thread:MessageThread, completion:([Message]) -> ()) 
 let query = KCSQuery(onField: "threadId", withExactMatchForValue: thread.entityId)
 messagesStore.queryWithQuery(query, withCompletionBlock:  (results, error) -> Void in
 completion(results as [Message])
 , withProgressBlock: nil)
}

Data Model Relationships

Kinvey supports data model relationships within both the core data store as well as the iOS SDK. In our situation, the lastMessage property on the MessageThread class is one such instance. When we fetch a thread, it looks at specific methods in our class to determine how it should handle references to other collection objects. In our case, the following methods allow it to treat this reference as a Message instance:

// Extracted from MessageThread.swift (http://tuck.cc/1w7jdOd)

// This method tells Kinvey to save the message in the lastMessage property
// when the thread is saved. If this method were not included, the message
// itself would not be saved when the thread is saved.
override func referenceKinveyPropertiesOfObjectsToSave() -> [AnyObject]! 
 return [
 "lastMessage"
 ]


// This maps the properties in the class to specific values in the Kinvey
// data store.
override func hostToKinveyPropertyMapping() -> [NSObject : AnyObject]! 
 return [
 "entityId" : KCSEntityKeyId,
 "lastMessage" : "lastMessage",
 "metadata" : KCSEntityKeyMetadata
 ]


// This method tells Kinvey that the lastMessage property is a member of
// the Messages collection. (You need to put the name of the Kinvey collection
// here and not the name of the class.)
override class func kinveyPropertyToCollectionMapping() -> [NSObject : AnyObject]! 
 return [
 "lastMessage" : "Messages"
 ]


// Here you tell Kinvey which class to map the lastMessage property to. This
// is how it knows how to build the object when it fetches it from the server.
override class func kinveyObjectBuilderOptions() -> [NSObject : AnyObject]! 
 let referenceMap:[NSObject : AnyObject] = [
 "lastMessage" : Message.self
 ]
 return [
 KCS_REFERENCE_MAP_KEY : referenceMap
 ]

Data Model Classes in Swift

For data model classes to work properly in Swift, they need to be able to leverage the default initializer. This means you need to have a default value for each property within the class. You can still leverage convenience initializers, as we have done here with the Message class:

// Extracted from Message.swift (http://tuck.cc/1w7kkgB)

// This initializer creates a Message instance based on the message text
// and the recipient ID. This is the initializer that is used when a
// user creates a new message in a conversation.
init(messageText:String, recipientId:String) 
 senderId = KCSUser.activeUser().userId
 self.messageText = messageText
 entityId = NSUUID().UUIDString
 metadata = KCSMetadata(userIds: [recipientId], includeActiveUser:true)

Note: For more information on the data store and data modeling in Kinvey, see the “Data Store22” guide.

Conclusion

Through this process, we have completed the core of Kinvey interactions for the application. However, with all of this in place, two key requirements still have not been met: data permissions and push notifications. In the next article, we will explore the permissions model in Kinvey, as well as the business logic functionality provided by the platform.

(da, al, ml)

Footnotes

  1. 1 http://www.smashingmagazine.com/2014/12/15/understanding-mobile-back-end-as-a-service/
  2. 2 http://www.kinvey.com/
  3. 3 http://www.smashingmagazine.com/2014/12/15/understanding-mobile-back-end-as-a-service/
  4. 4 http://www.kinvey.com/pricing-starter
  5. 5 http://www.kinvey.com/pricing
  6. 6 https://slack.com/
  7. 7 http://www.universalmind.com/
  8. 8 https://github.com/davidtucker/WaterCooler-Demo
  9. 9 http://www.smashingmagazine.com/2014/12/15/understanding-mobile-back-end-as-a-service/
  10. 10 http://www.smashingmagazine.com/wp-content/uploads/2015/03/01-watercooler-demo-app-opt.jpg
  11. 11 http://www.smashingmagazine.com/wp-content/uploads/2015/03/01-watercooler-demo-app-opt.jpg
  12. 12 https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/Introduction/Introduction.html
  13. 13 http://www.kinvey.com/
  14. 14 http://www.smashingmagazine.com/wp-content/uploads/2015/03/02-new-app-kinvey-opt.jpg
  15. 15 http://www.smashingmagazine.com/wp-content/uploads/2015/03/02-new-app-kinvey-opt.jpg
  16. 16 http://devcenter.kinvey.com/ios/guides/getting-started
  17. 17 http://devcenter.kinvey.com/ios/guides/getting-started
  18. 18 http://www.smashingmagazine.com/wp-content/uploads/2015/03/03-user-management-opt.jpg
  19. 19 http://www.smashingmagazine.com/wp-content/uploads/2015/03/03-user-management-opt.jpg
  20. 20 http://devcenter.kinvey.com/ios/guides/users
  21. 21 http://devcenter.kinvey.com/ios/guides/files
  22. 22 http://devcenter.kinvey.com/ios/guides/datastore

The post Putting Mobile Back End As A Service Into Practice (Part 1) appeared first on Smashing Magazine.

This article – 

Putting Mobile Back End As A Service Into Practice (Part 1)