The Affiliate Marketing Revolution

Affiliate marketing is a revolution in business. Hundreds of companies have formed and succeeded on the foundations of affiliate marketing.

A method of referral marketing that allows us to build online businesses without creating any products at all.

It’s a form of business that gives pretty much everyone the opportunity to start a profitable online business without expert knowledge or geeky technical skills.

How does affiliate marketing work exactly?

Affiliate marketing dates back to the prehistoric times before the internet. Where people would earn commissions for referring customers in the physical world. The same concept applies on the internet today.

The same concept applies on the internet today.

You recommend a product that you like and you make money in the form of commissions for anyone you refer that goes on to make a purchase.

This infographic I found on Bengu illustrates what affiliate marketing is and how it works:

what is affiliate marketing?

At it’s core, its a fairly simple business model. Simple but super lucrative.

So why affiliate marketing?

Affiliate marketing is a revolution in business because of the advantages it possesses over other traditional forms of business.

Some of the benefits of affiliate marketing include:

  • Work from anywhere – Affiliate marketing is an online business. This means you can run your business entirely from your computer. This gives you total location independence.
  • Work for yourself – Many of us just aren’t wired for working for a boss. We feel that inherent desire to strike out on our own and create something that can sustain ourselves. Being self-sufficient financially is a beautiful thing. Affiliate marketing makes it entirely possible.
  • Financial freedom – Unlike salary paid work. Starting an affiliate marketing business doesn’t have a salary cap. What you earn depends on what you do and how you do it. The possibilities are endless.
  • Fulfillment – Many people find themselves in jobs that are soul destroying. Zero use of creativity and mind-bogglingly boring. Due to its versatility, affiliate marketing enables you to build a business around something you feel strongly about. A fulfilling business that can make you very wealthy.

How do people actually make money from it?

Creating an income from affiliate marketing requires sound marketing knowledge. It requires an approach that is focused on providing value for your visitors. A place where you’re genuinely trying to help people out and give them the best information possible.

Many affiliate marketers are lazy. They don’t bother to create amazing content and do their research properly because they’re just looking to make a quick buck. These are the people that are quick to start but don’t hang around for very long after they realize how much work it actually takes to be successful.

Which brings me on to my next question…

Isn’t It Just Another Get Rich Quick Scheme?

Skepticism is rife among people today and for good reason. A lot of people in the past have exploited hungry audiences by making false promises and outrageous claims about results.

To be completely honest with you, affiliate marketing is difficult. Nothing worthwhile is going to be easy. So if you’re coming into this with the mindset of making money very quickly then this isn’t something for you.

Affiliate marketing requires hard work. You need to learn how to market to people. Which involves understanding human psychology. Learning about what makes people tick. You also need to learn how to create amazing content that makes people want to buy things from you.

This is called content marketing.

Another thing that needs to be mastered is the entrepreneurial mindset.

People that are successful in business aren’t successful because of luck or because they followed some “proven technique”. They may have followed a powerful blueprint to help them get to where they are but fundamentally, their mindset has shaped the landscape for their business and general prosperity.

The way entrepreneurs think about money compared to the way employee’s think about money is very different.

Learning about all this stuff is key to fostering long-term success.

The reward for learning and mastering all this stuff is a complete change in lifestyle. More than just that, its completely life-changing in general because changing the way you think and perceive things will change the way you act and feel about things in your life.

It’s so much more than just making money.

What’s The Best Way To Start?

Starting affiliate marketing can be hard. Heck, starting anything is hard when you see the number of options available to you. In terms of affiliate marketing, the best affiliate programs are the ones that give you the best ROI.

You return on investment all depends on your method of promotion. That is something you need to work out for yourself.

Generally speaking though, your affiliate marketing training is the most important part of your business, when you’re first starting out. The quality of your output is directly linked to the quality of your input.

Do your research and find marketing training that not only teaches you how to do market products and make sales but also empowers you with an entrepreneurial mindset. So you can maximize your chances of success in any type of business.

You know those people that just seem to turn everything they touch into gold? They aren’t superhuman. They’ve just cultivated the right mindset that’s required for success and prosperity in their life.

Empowering yourself with the right knowledge is the key to success in affiliate marketing and everything else.

Seven Interesting SEO Trends For 2017 [Infographic]

SEO stands for search engine optimization. It’s a method that websites use to rank highly in the search engines.

SEO is a huge part of online business as most people that use the internet use search engines as their starting point. Businesses spend millions every year hiring agencies to help them rank higher for their most important pages.

An example of one such SEO agency is Bubblelocal. They specialize in helping businesses rank higher in Google. An agency like this typically provides a full-service solution for clients that includes things like web design, content marketing and conversion optimization.

These agencies can be extremely valuable as they provide a “hands-off” approach to your website rankings, lead generation and content creation.

A first page ranking for a high competition search term in Google is money. Plenty of search terms generate hundreds of thousands of dollars every month for online businesses.

SEO is huge.

It’s interesting to note that search engines aren’t the internet. A common misconception people have when they use a search engine is that they’re searching the internet. What’s actually happening is that the person is searching the index of that particular search engine.

Search engines index a large portion of the internet but they don’t have everything!

In terms of convenience though, search engines provide the easiest way to find what you’re looking for on the world wide web.

Seven Interesting SEO Trends For 2017

As a digital marketer, it can be really difficult to keep up with everything happening in the world of marketing. Digital marketing is a dynamic beast (to put it lightly) and one of the most important marketing channels to stay up to date with is SEO.

I came across this interesting infographic created by web agency KOL Limited. This gorgeous image showcases seven interesting trends that we should look out for in the SEO space this year.

The agency predicts that user intention, rich snippets, and cross channel marketing will play a huge part in the trends for this year. Mobile page speed is also featured as well as HTTPS and artificial intelligence.

seven interesting SEO trends for 2017

 

5 Steps To Starting An Online Business From Scratch

Starting an online business from scratch doesn’t have to be the hardest thing in the world. We’re quite honestly, spoilt for choice in this day and age when it comes to digital business.

There are hundreds of online business ideas out there today that we can capitalize on. This crazy level of choice we have coupled with the amount of noise we’re subjected to online can have a negative impact on us though.

How? Becuase It’s very difficult to know what you want to go for when we have too much choice. There are just too many variables involved.

Following these 5 steps will help keep you on the straight and narrow when you embark on your journey for online success.

I – Have a Plan of Action

plan of action

Navigating the digital wilderness can be a daunting thing. Most of us feel completely overwhelmed when we first find out about online business. That said, once you do find the type of business you want to start, it’s essential that you create a plan.

I’m not talking about a 40-page traditional business plan here. I’m talking basic roadmap so you know where you’re going. It doesn’t need to be anything fancy, but it’s a vital part of your online business strategy.

You can create a business plan on a simple excel spreadsheet, outlining your weekly and monthly tasks and goals. A simple table will suffice for this.

Something you need to be crystal-clear on, are the actions you’re taking. Are they actions that are money-producing? Will they have a direct impact on your bottom line?

If you’re spending 80% of your time tweaking the design on your website, you won’t make any money.

II – Get The Right Training

The right training in paramount to your success in any business venture. The knowledge you have on your chosen field of business will dictate the type of results you get. There are amazing training programs available for every type of online business.

Whether you’ve decided to go for freelancing, affiliate marketing, consulting or dropshipping, you’ll be able to find powerful training from people who have made a lot of money with these types of businesses.

III – Narrow Your Focus

laser focused

It’s tempting isn’t it? All those shiny objects you see out there. Marketers pulling you in with their irresistible promises of wild results from their programs.

If you want to successfully start an online business from scratch, you need to cut the noise. Once you decide to go for something, don’t give anything else the time of day.

Did you know that the average attention span is literally seven seconds now?

Focus is the currency of the 21st century. If you can cultivate a level of focus that lets you concentrate on a task at hand for hours without distraction, you’re way ahead of most people.

I know the offers people have are so tempting. They can almost make your methods seem redundant at times but it’s important to stick to your guns if you want to make solid progress and get results in a short space of time.

IV – Site Design & Content

Whichever online business you decide to go for, you’ll probably create a website as well as some content at some point.

Site design is becoming something increasingly important. Personally, if I come across a website that looks like it’s still stuck in the 90’s, I’m instantly turned off.

I hit that back button faster than you can say “click”.

The crazy thing is, building a beautiful website and crafting a memorable logo for your business can be done by literally pressing a few buttons. WordPress websites enable us to install themes on our sites at the touch of a button. A theme covers the look, design, feel and functionality of your website.

There are thousands of free themes for you to choose from so it doesn’t even have to cost anything.

Stumped on the type of logo you want for your brand? Logo design services like Juicy can create outstanding logo’s for you at reasonable prices. You really don’t need to do everything yourself!

V – Execution Is the Key

People are always looking for the “secret” to success. As if there’s some kinda magic ingredient that provides a shortcut to prosperity.

The truth is, there really is no secret at all.

The secret is hustle.

You gotta work hard to earn your keep.

Execution is what separates the men from the boys in the world of business. The people that put themselves out there and ruthlessly take action are the ones that reach success.

Don’t worry about perfect timing. It doesn’t exist. The stars aren’t going to align for you to create your dream life. You just need to take action and make it happen yourself.

Your days should consist of 20% learning and 80% executing on the things you’ve learnt. The best way to learn is to do. You’ll learn more from experience than you will from any textbook. Nothing beats reference experiences.

Web Mining via Phantom.js and Sharpkit

When it comes to web scraping, having a real, physical web browser is a chore. Not only is it a problem to open 10+ copies of IE, but the whole idea of showing up UI on a machine that may not have an operator to close it should things go awry is something that feels, well, very wrong to me.

Unfortunately, there is no headless WebKit library for .Net and current approaches all either have Java or JavaScript bindings or, alternatively, suggest that you use IKVM. However, this got me thinking: if an IKVM-driven port works (albeit not very well, in terms of performance, at least), then how about going in the direction of JavaScript solutions such as Phantom.js?

And then it hit me: I’ve already good a transcompiler called SharpKit that knows how to translate C# to JavaScript. So what if I were to simply write my code in C#, then let Phantom.js execute it as JavaScript?

What is Phantom.js, anyway?

Phantom.js is a dual API: it contains both its own APIs as well as APIs exposed through the webpage and fs modules of CommonJS. As a result, to get this API within SharpKit, I would have to trail through these APIs and generate corresponding C# classes and methods for them. This is actually fairly trivial – all I have to do is to decorate the class with [JsType(JsMode.Prototype)] and the methods with [JsMethod/JsProperty] and everything would work.

As you can see, it’s impossible to redefine property names, so the C# API has lost some of its gloss. But that’s not critical. What’s important it that I’ve been able to replicate the API of both the phantom and WebPage objects in C#. I didn’t go for the CommonJS modules because it seemed that the existing features, together with the DOM and jQuery APIs provided by Sharpkit are more than enough.

Trying It Out

To try things out, I rewrote the Phantom pizza-searching example to use C#. Here it is, in all its glory:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
var page = new WebPage();
string url = "http://lite.yelp.com/search?find_desc=pizza&find_loc=94040&find_submit=Search";
page.open(url, status => {
  if (status != "success") console.log("Unable to access network");
  else
  {
    var result = page.evaluate(() =>
    {
      var list = document.querySelectorAll("span.address");
      var pizza = new JsArray<string>();
      for (int i = 0; i < list.length; i++)
      {
        pizza.push(list[i].innerText);
      }
      return pizza;
    });
    console.log(result.As<JsArray<string>>().join("n"));
  }
  Phantom.exit();
});

Surprisingly enough, there aren’t that many caveats to note here. One issue I had is how to return types from methods that should, in all fairness, be made generic. In the end, I ended up deciding that it’s better to leave the return type as JsObject and then using the As<>() method to cast the result to whatever I actually need. The explicit type would have to appear eventually, unless of course we went with dynamic – but then again, I don’t know if this even possible.

Needless to say, the example worked out of the box, which shouldn’t really be surprising considering that I actually peeked into the resulting JS file and saw that what was generated.

Persisting Data

There’s no way getting around the fact that, with this approach, your main data mining process will be spawning an extra process for PhantomJS to do its work. Given that Phantom seems to only support the fs module, the expected mechanism for communication between the mining service and phantom would appear to be file storage. (This implies that progress monitoring is, effectively, impossible.)

At any rate, I have replicated fs in SharpKit, adding just enough of the methods in order to get the ball rolling. Annoyingly enough, I’ve declared the require() instruction in a rather strange fashion:

1
2
3
4
5
6
7
8
9
[JsType(JsMode.Prototype, Export=false, Name = "require")]
public static class Require
{
  [JsMethod(Name="require", Global = true)]
  public static JsObject Module(string moduleName)
  {
    return null;
  }
}

There’s probably a better way out there, as this approach requires me to use the As<>() method again to get the right module type. Ah well.

1
2
// not very pretty
var fs = Require.Module("fs").As<FileSystem>();

Given that PhantomJS uses Qt, Python and who knows what else, it’s hardly surprising that its file system API doesn’t like standard Windows paths such as c:somewhere.txt. Not a big deal, really, because we can just write to the current directory, read off the data by our web minder, and then delete the file when we’re done. The file name would typically be provided as a parameter to the phantomjs.exeprocess (we get the parameters as a collection, remember?).

It’s All Gone Pear-Shaped

Having verified that the file system calls work (somewhat), I’ve decided to jump in and rewrite one of my WatiN-driven workflows using this new PhantomJS framework. That’s when I hit a couple of fairly serious problems:

  • First of all, Phantom refused to work over SSL. It took some searching to figure out that, in the latest dynamic release, the authors simply forgot to include one of the required DLLs. Luckily, that was easy to fix.
  • The next annoying thing I discovered is that doing something wrongly within Phantom basically causes your program to either hang or exit without any explanation. There is no debugging as far as I can see, which makes tracking things down impossible (compare with WatiN, where debugging is sensible).
  • The jQuery API turned out to be insufficient for the purposes of data mining. That’s when I realized where the business value of WatiN is – the ability to write something like browser.Forms[0].TextField(t => t.Name.StartsWith("test")) is what makes WatiN a lot more usable. True, you can try to get the same result with jQuery selectors, but those typically cause silent failure and are not statically checked the wame way WatiN-based LINQ expressions are.

That last bullet point is the killer, as far as I can tell. Essentially, what this means is that if I want to have a good LINQ-driven selection mechanism, I have to write my own APIs on top of jQuery to give me the collections in the format I want. Furthermore, were I to do this (and this is a fairly substantial task), there would still be a problem debugging into these collections as they are iterated and processed.

Back to the homepage.

Chained null checks and the Maybe monad

A great many programmers have met a situation where, while accessing a nested object property (e.g., person.Address.PostCode), they have to do several null checks. This requirement frequently pops up in XML parsing where missing elements and attributes can return null when you attempt to access them (and subsequently trying to access Value throws a NullReferenceException). In this article, I’ll show how a take on the Maybe monad in C#, coupled with use of extension methods, can be used to improve readability.

Problem Description

So, to start with, let’s look at the way to get a person’s post code (just imagine you’re working with XML or something). The code shown below does several nullchecks and assigns the value only if it is available.

1
2
3
4
5
string postCode = null;
if (person != null && person.Address != null && person.Address.PostCode != null)
{
  postCode = person.Address.PostCode.ToString();
}

What you’ve got up there is some fairly unreadable (and un-maintainable) code. Actually, we’re lucky to have all of our code fall under a single if – something that might not be possible in a more complex scenario. Let’s imagine a more complicated situation – say we need to perform some operation between the if evaluations. What do we get? That’s right – a chain of ifs.

1
2
3
4
5
6
7
8
9
10
11
12
string postCode;
if (person != null)
{
  if (HasMedicalRecord(person) && person.Address != null)
  {
    CheckAddress(person.Address);
    if (person.Address.PostCode != null)
      postCode = person.Address.PostCode.ToString();
    else
      postCode = "UNKNOWN";
  }
}

The code presented above contains a lot of excess data – for example, person.Address.PostCode is mentioned twice. There’s nothing incorrect about the code per se, it just has a bit too many symbols. To sum up, we want our code to communicate better that

  • If the value is null, no further evaluations should be done; if the value is notnull, then this is the value we’re going to work with
  • If we perform some action, it only happens on a valid object

So what am I suggesting? I propose that we create a fluent interface that will satisfy the above conditions without any nesting. To do that, we are going to employ the Maybe monad.

For those of you who know F#, the Maybe monad will be familiar as the Option type. For C# developers, let’s just assume that you can have variable that either have Some value or no value (None). Of course, C# doesn’t directly support this none-some duality except by using null. Which is precisely why I’m proposing the chained extension solution presented below.

With

Our primary concern is to do the null checks to ‘shorten’ them so they don’t pollute our code. For that, we’ll define a With() extension method:

1
2
3
4
5
6
public static TResult With<TInput, TResult>(this TInput o, Func<TInput, TResult> evaluator)
  where TResult : class where TInput : class
{
  if (o == nullreturn null;
  return evaluator(o);
}

The above method can be attached to any type (because TInput is effectively object). As a parameter, this method takes a function which defines the next value in the chain. If we passed null, we get null back. Let’s rewrite our first example using this method:

1
2
3
string postCode = this.With(x => person)
                      .With(x => x.Address)
                      .With(x => x.PostCode);

I suppose, in the above example, we could replace Func<> with Expression<> and try to pull properties, but I’ve seen this done and the resulting code is too slow and it’s also somewhat limiting – it assumes that you’re working with just one object, whereas my Maybe chains can (and do) drag in many objects.

Return

Here comes another piece of syntactic sugar – the Return() method. This method will return the ‘current’ value just like Where() does, but in case null was passed, it will return a different value that we supply. Consider this a kind of «Where() with fallback» method.

1
2
3
4
5
6
public static TResult Return<TInput,TResult>(this TInput o, 
  Func<TInput, TResult> evaluator, TResult failureValue) where TInput: class
{
  if (o == nullreturn failureValue;
  return evaluator(o);
}

So let’s assume now that, with the absense of a postcode, we want to return, say, string.Empty. Here’s how:

1
2
string postCode = this.With(x => person).With(x => x.Address)
                      .Return(x => x.PostCode, string.Empty);

By the way, you could rewrite the extension method so that failureValue would also be computed via a Func<> – I am yet to meet a scenario where this is required, though. It is typically the case that we never know at which stage the chain failed (and yielded null), so the terminal Return() is typically an indicator (either true/false or null/not null).

If & Unless

Going through the call chain, you sometimes need to do checks not related to null. Theoretically, you could suspend the chain and use an if, or you could use an ifin one of the delegates, but… you can simply define an If() extension method (and an Unless() if you feel like it) and plug it into the chain:

1
2
3
4
5
6
7
8
9
10
11
12
13
public static TInput If<TInput>(this TInput o, Func<TInput, bool> evaluator) 
  where TInput : class
{
  if (o == nullreturn null;
  return evaluator(o) ? o : null;
}
 
public static TInput Unless<TInput>(this TInput o, Func<TInput, bool> evaluator)
  where TInput : class
{
  if (o == nullreturn null;
  return evaluator(o) ? null : o;
}

Do

Seeing how we’re having a party here, let’s add yet another method that simply calls a delegate – and that’s it. Of course, this method is best used for one-line calls and not for evaluating 20-line algorithms with convoluted logic. Nevertheless, the call is quite useful in practice.

1
2
3
4
5
6
7
public static TInput Do<TInput>(this TInput o, Action<TInput> action) 
  where TInput: class
{
  if (o == nullreturn null;
  action(o);
  return o;
}

So, we’re done: we’ve got the infrastructure we need to get our post code extraction to be a bit more readable. Here is the end result:

1
2
3
4
5
6
string postCode = this.With(x => person)
    .If(x => HasMedicalRecord(x))]
    .With(x => x.Address)
    .Do(x => CheckAddress(x))
    .With(x => x.PostCode)
    .Return(x => x.ToString(), "UNKNOWN");

As you can see, the depth of nesting has fallen to zero – no more curly braces!

Discussion

I use these Maybe-monadic-chain-null-extension-methods (call them how you will) in my R2P software product. Here’s an example of real-life use of these constructs:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
public override void VisitInvocationExpression(IInvocationExpression expression)
{
  base.VisitInvocationExpression(expression);
  string typeName = this.With(x => expression)
    .With(x => x.InvokedExpression)
    .With(x => x as IReferenceExpression)
    .With(x => x.Reference)
    .With(x => x.Resolve())
    .With(x => x.DeclaredElement)
    .With(x => x.GetContainingType())
    .Return(x => x.CLRName, null);
  this.If(x => Array.IndexOf(types, typeName) != -1)
    .With(x => ExpressionStatementNavigator.GetByExpression(expression))
    .Do(x =>
          {
            var suggestion = new SideEffectSuggestion(typeName);
            var highlightInfo = new HighlightingInfo(
              expression.GetDocumentRange(),
              suggestion);
            context.HighlightingInfos.Add(highlightInfo);
          });
}

As the owner of DevTalk, I feel I have to point out here that, at any point, you can stop the chain and start a new one. Why would you want that? Well, for example, you cannot define shared variables within the chain (unless you refactor it all to have a Dictionary<string,object>-like parameter).

By the way, quite frequently I find myself making additional, domain-specific methods to plug into this chain. For example:

1
2
3
4
5
6
7
public static IElement IsWithin<TContainingType>(this IElement self) 
  where TContainingType: class, IElement
{
  if (self == nullreturn self;
  var owner = self.GetContainingElement<TContainingType>(false);
  return owner == null ? self : null;
}

One more thing: this type of notation is actually light obfuscation because, as I’m sure you’ve guessed, each extension method call will be shown as a static method call in Reflector:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
public override void VisitInvocationExpression(IInvocationExpression expression)
{
    base.VisitInvocationExpression(expression);
    string typeName = this.With<SideEffectAnalyser, IInvocationExpression>(
    delegate (SideEffectAnalyser x) {
        return expression;
    }).With<IInvocationExpression, ICSharpExpression>(delegate (IInvocationExpression x) {
        return x.InvokedExpression;
    }).With<ICSharpExpression, IReferenceExpression>(delegate (ICSharpExpression x) {
        return (x as IReferenceExpression);
    }).With<IReferenceExpression, IReference>(delegate (IReferenceExpression x) {
        return x.Reference;
    })
    
    // and so on
}

This approach is easily extensible – for example, a colleague of mine does try-catch checks in his chains, too. Hey, this is kind of like AOP, but without post-build or dynamic proxies. Oh, and the performance hit for these chains is negligible compared to if statements.

That’s it! Comments are, as always, welcome! Oh, and if you like this article, please vote for it on CodeProject.  ■