The Absolute Beginning for Amazon Alexa Voice Skill Development

An Introduction to this Alexa Learning Journey

So if you’ve visited my site at all in the past, you’ll notice this is the most blogging I’ve done in…ever? Put another way, a significant confluence of factors has dialed up my motivation to doggedly pursue learning and growth. So, here we are at learning Alexa skills!

A few weeks ago, I was suckered by the cheap promise of a free hoodie from Amazon, in exchange for building and publishing my first Amazon skill. You can experience the equally cheap output of that effort by saying, “Alexa, start silly marketing strategies” (again and again.)

Is it a good skill? No! Nor am I going to pull a Dollar Shave Club here either. It’s a bad skill! It’s not interactive. You just have to keep asking it over and over for some dumb buzzword-laden sentences. I promise I only account for 75% of the utterances. 🙂

2017-01-25-001-Silly-Marketing-Strategies

Honestly, I’m thrilled to have published an Alexa skill. But there’s so much more out there! Thus, I’m embarking on yet another educational journey, this one into Amazon Alexa Voice Skill Development.

Getting Set Up with Resources You Need for Alexa Skill Development

The instructions below are for PC only. Apologies, Mac users!

  1. You need to create a folder directory in which we’ll be housing our various materials and code.
  2. Visit the Alexa Skills Kit JS Git Hub page and download all materials as a ZIP.
    1. 2017-01-25-002-Alexa-Skills-Kit-JS-Git-Hub
  3. Once you’ve downloaded the ZIP file, move it from your default Downloads directory, and into the folder you created in Step 1.
  4. Extract the ZIP file. The unzipped folder should be named, by default, “alexa-skills-kit-js-master”. Within the unzipped folder is yet another folder of the same name.
  5. Take the all the contents within the two folders described above, and move them into the “Alexa” directory, higher up.
    1. Move the contents from the “samples” folder into the main “Alexa” directory, so the skill folders (spaceGeek, reindeerGames, etc.) are in the umbrella directory.
  6. When you’ve completed Step 5, you should be left with A) Three text files, and a bunch of skill folders, B) an empty “samples” folder [A&B you moved up two directories into the “Alexa” umbrella folder], C) an empty “alexa-skills-kit-js-master” folder and D) the original zip file.
  7. Delete items B, C, and D from step 6.
  8. Download and install a code/text editor. I personally prefer Sublime Text 2, but a lot of folks prefer Notepad++ as well.
    1. A dedicated code/text editor is highly preferable here, as much of the code for the Alexa skills in JS – Node.JS in particular, I believe.
  9. After you’ve muddled your way through this folder architecture, go into the README file and not the order of Skills. Number the skill folders accordingly in the umbrella directory, excluding helloWorld. (You should have skills 1-9, starting with spaceGeek and ending with ChemistryFlashCards.)

2017-01-25-003-Alexa-Folder-Structure

Alright, that’s it for now! Next, we’ll look at setting up access to Amazon Developer and Amazon Web Services.

DSC_0037 (2) Zach Doty Cover Photo for SQL SELECT Clauses & Statements

The SELECT Clause, SQL Statement Fundamentals

Getting Started in SQL Statement Fundamentals

Howdy, all, welcome back to our journey learning SQL. This post will deal with basic SQL statements. In fact, most of these SQL statements should be applicable to most major types of SQL databases (MySQL, Oracle, and so forth.)

The SELECT Statement (or Clause)

First up, we’ll start with the “Hello World” of SQL: SELECT. We’ll look at the formal conventions of the SELECT statement and some examples using the statement. A quick aside: SELECT is also often known as a clause in SQL settings. For the purpose of this article, the educational materials I’m walking through proposes clause and statement may be used interchangeably for these purposes.

SELECT is one of the most common tasks in querying data tables with SQL. Further, it has many clauses that may be combined to form a powerful query. Let’s look at the basic form of a SELECT statement. Below, you will use the SELECT statement to call in a column or some column names, separated by a comma if multiple columns, then FROM a table.

SELECT column1,column2,column3 FROM table_name;

So, breaking down again the select statement.

  1. Specify a list of columns in the table which you want to query via the SELECT clause
  2. Use a comma between each column you are querying, if multiple columns
    1. If you want to query all columns in a data, save yourself some time by using the * asterisk wildcard as a shortcut for selecting all columns
  3. After you’ve called in the appropriate columns in the SELECT clause, follow it with FROM, where you indicate the appropriate table name

 

Sidebar 1: Random facts about the SELECT statement and SQL language

Time for a TV timeout! Did you know that that the SQL language is case insensitive? So if you use “SELECT” or “select”, you should get the same results. For the purposes of this education and sharing, SQL clauses / keywords / statements will be typed in all uppercase caps to make the code easier to read and stand out among all this text. 🙂

Okay, just one more sidebar note! It’s generally not encouraged to use the asterisk (*) select all columns wildcard in queries. Why? If you have a robust table with a ton of columns and a great depth of data beneath those columns, you could be placing unnecessary load on yourself, the SQL server and the SQL application (pgAdmin / PostgreSQL).

 

Application Example 1 for the SELECT Statement

Let’s jump into executing actual SQL commands against databases in pgAdmin!

Below, I’m going to open the file tree, select “dvdrental”, then click “Tools” in the top menu, and select “Query Tool” to execute arbitrary SQL queries and statements.

 2017-01-22-001-pgAdmin4-PostgreSQL-Open-Query-Tool

You should then see the screen below if you are in pgAdmin 4. If you are in pgAdmin 3, then it should appear as a new window.

2017-01-22-002-pgAdmin4-PostgreSQL-Query-Tool-Start

Let’s have some fun, why not go against our own advice and query a whole table? Below, you can see in the query window, we’ve typed:

SELECT * FROM actor;

Into layman’s terms from above, we’re selecting (SELECT) all columns (*) from (FROM) table actor (actor).

Important: My image example doesn’t show it below, please, put a semicolon at the end of the line! (I got hasty making screen shots. 🙂 )

2017-01-22-003-pgAdmin4-PostgreSQL-Query-All-Columns-Actor

After you’ve typed the query, go to the lightning bolt above the window, and click “Execute/Refresh”. I’m just going to punch F5, because I’m about that keyboard shortcut life. In the future, I’ll likely introduce a command or action, note its keyboard shortcut and use that shortcut moving forward for any other examples.

The query should run and refresh. I now have a new tab in pgAdmin, with data output returned from my query. Let’s take a look below.

2017-01-22-004-pgAdmin4-PostgreSQL-Query-All-Columns-Actor-Execute

Okay, so we’ve got four columns returned: actor_id, first_name, last_name, and a last_updated. You’ll also note that below the column names are quick descriptions of the data type for each column. And of course, we see our beloved celebrity data returned below, all 200 rows.

Let’s examine further the data types listed below each column name. The integer below actor_id is pretty simple, numbers. Next, the character varying, below first_name and last_name. Character varying is essentially just string text. The (45) denotes the limit on character count length. Last, the timestame with YYYY-MM-DD and military style HH:MM:SS.XX time, without time zone. We won’t worry too much about the timestamp for now.

If you’re somewhat knowledgeable in SQL, you may rightly decry our glossing over of data types. For beginners, data types will be covered in more detail later. Data types will become increasingly important later, as we execute statements such as, WHERE, in which data types make or break the query. Promise, we’ll cover data types in more detail later.

 

Application Example 2 for the SELECT Statement

So we kind of broke our rules in the first SELECT statement SQL query example. However, some rules were made to be bent or broken, yes? In this example, we’ll follow best practices a bit more closely and select a column or columns by name from a table within the dvdrental database.

Remembering our SELECT column1,column2,column3 FROM table_name format, consider the below, and see it typed in (with closing semicolon on the statement!

SELECT first_name,last_name FROM actor;

2017-01-22-006-pgAdmin4-PostgreSQL-Query-Two-Columns-Actor

Before we execute and refresh via F5, please note that I’ve not included spaces between the column names and comma in the statement. Alright, below is what we see when we execute and refresh.

2017-01-22-007-pgAdmin4-PostgreSQL-Query-Two-Columns-Actor-Execute

In our screen shot, we see at bottom right, confirmation of the query execution. In the output window, we’ll only see what was queried: first_name, last_name. So we’ve left out the actor_id and last_updated columns.

One more note on our output, you’ll notice that all 200 rows were returned for this query. If you think about enterprise level data, that could be 200 million rows, zoinks! As we progress through our material, we’ll look at the aforementioned WHERE statements and other conditions / methods to limit or control the rows in query output.

Perfect Practice Makes Perfect

For the educational benefit, we’ll reinforce and apply what we’ve learned one more time. Let’s say that we’re a business and marketing analyst back in time when DVDs were still used (it’s okay to laugh!) We need to send a New Year’s promotional email (It’s January 2017 when this post was originally published) to all existing customers. We’re going to build and execute a query to that effect.

Below, you can see we’re still in the dvdrental database, in the arbitrary query code input window, with statement: SELECT first_name,last_name,email FROM customer;

2017-01-22-008-pgAdmin4-PostgreSQL-Application-Query-Existing-Customers

One last quick note on syntax and formatting: you can go multi-line! In the below screenshot, we have typed the same query, but added formatting. Explained: SQL will read your code as one line until it runs into the closing semi-colon (;). A common practice is that for every keyword, a new line is created in the query. (Of course, the statement is not closed via semi-colon until appropriate.) I’ve also taken one more step below from various ranging coding practices (CSS, C++, etc.) and indented the ongoing portion of the query to help visually break up the code a bit.

2017-01-22-009-pgAdmin4-PostgreSQL-Application-Query-Existing-Customers-Multi-Line

Wrap-Up

Woohoo, we did it! We ran our first basic SQL queries in pgAdmin / PostgreSQL. We learned how to select all columns within a table and select separate desired columns within a table. Be sure to re-visit my other articles on learning SQL, visit the previous article on restoring an SQL database with table schema only.

In our next post, we’ll learn about using a SELECT DISTINCT statement.

Restoring a SQL Database with Table Schema Only in pgAdmin x PostgreSQL

Howdy! Welcome back to our shared journey of learning SQL. Last time, we learned about creating, deleting and completely restoring SQL databases in pgAdmin. Today, we’ll learn about how to restore a database, but only its table schema.

Specifically, we’ll restore the table names and preferences for types of data within those tables. However, the actual data itself won’t be ported in.

Think of it as taking your house or apartment, and recreating, but you don’t move in with the furniture. (Maybe a sibling instead? 🙂 ) According to the material I’m working through, this method of database restoration is very common and is something we should have down pat.

 

Database Table Schema-Only Restoration, Method 1

An easy method to start this is to right click on the Databases header near the top of the file tree, and to select “Create” > “Database”. With a fresh new database, we’ll have flexibility to do some more management on the “front” side of things. (Knowing I may be abusing terminology a bit, but makes sense to me while writing this.)

 

2017-01-21-001-pgAdmin4-PostgreSQL-Restore-Database-Table-Schema-M1-P1

For this example, I’ve finished the new database creation by naming (“OnlySchema”) and saving a new database. Below, you can see the new database in the file tree. Also, if we click through the tree as such, “Schemas” > “public” > “Tables”, we’ll notice there are no tables! (Compare that path exploration to the dvdrental database tables, where you can find 15 tables.)

 

2017-01-21-002-pgAdmin4-PostgreSQL-Restore-Database-Table-Schema-M1-P2       2017-01-21-003-pgAdmin4-PostgreSQL-Restore-Database-Table-Schema-M1-p3

Anyway, let’s get on with restoring table schema only!

  1. Right click on “OnlySchema” and select “Restore”
  2. Select the “Custom or tar” option for the Format field
  3. Select the file via the dialogue, or paste in your file path
    • Up to this point, you should notice we’ve taken the exact same steps for a full database restore. However, #4 is where things are slightly different. Pay attention!
  4. As shown below, click “Restore Options”, and activate the radio button for “Only schema” to yes
  5. Click “Restore” and refresh!

 

2017-01-21-004-pgAdmin4-PostgreSQL-Restore-Database-Table-Schema-M1-p4

After the refresh, we should see something like below, where if we select the tables option and view “Properties”, we’ll see 15 empty named tables.

 

2017-01-21-005-pgAdmin4-PostgreSQL-Restore-Database-Table-Schema-M1-p5

 

Method 2: Schema-Only Restoration onto a Database with existing tables, data

What if we’re working with a database that contains existing tables and data? And suppose we need to restore only the schema? Perhaps an error was committed in formatting / management and must be corrected.

Fortunately, this method of restoration is extremely similar to Method 1. For this scenario, there’s one added step toward the end:

  1. Right click on “OnlySchema” and select “Restore”
  2. Select the “Custom or tar” option for the Format field
  3. Select the file via the dialogue, or paste in your file path
  4. Click “Restore Options”, and activate the radio button for “Only schema” to yes
    • Here’s our jump off point, the next step is what differs from Method 1.
  5. Scroll down the dialogue box slightly. You should see a field and radio button for “Clean before restore”. Activate the radio button to “Yes”
  6. Click “Restore” and refresh!

 

2017-01-21-006-pgAdmin4-PostgreSQL-Restore-Database-Table-Schema-M1-p6

After running the restore job and refreshing, we can verify the Schema Only and data clean prior to restoration occurred correctly. Below, we can click through the file tree down from “dvdrental” > “Schemas” > “public” > “Tables” and check the table properties to see that there are zero (0) rows of data.

 

2017-01-21-007-pgAdmin4-PostgreSQL-Restore-Database-Table-Schema-M1-p7

 

Wrap Up

I do hope these articles are serving a useful introduction to navigating pgAdmin, and getting familar with the foundations of PostgreSQL and databases. In the forthcoming articles, we’ll start learning about basic SQL syntax. To keep track of all the shared SQL posts and learnings, visit the SQL Education page for a list of articles to date. Cheers!

DSC_0034 Zach Doty Cover Photo How to Learn SEO in Five Minutes

How to Explain SEO in 5 Minutes

Today, you’re going to learn how to explain SEO to anyone in five minutes! Is it a comprehensive, end-all, be-all example? No. Will it help someone quickly understand the basics of a complex practice? Yes. Let’s jump in. This is, after all, a five minute guide!

Starting Point: SEO is not a black box.

For context, I often hear that SEO is a “black box” and it’s anyone’s guess as to how you rank in search engines. I’m always happy to hear that! It means we have a chance to explain what SEO is really about. Google isn’t a black box. Rather, its algorithms and search engines are so complex at a large scale, it’s difficult to comprehend on a daily basis.
With introductions out of the way, here’s how you do it:
A Job Application
Consider SEO like a job application. You have a resume, references, you deal with a recruiter and a hiring manager. And you want a great career!
In SEO, you have a website, backlinks, the search engine and the user. You want to be found and loved!

Your Resume
Your resume is your website. You control the content and tailor the experience to each opportunity. You balance who you are and what you do.
Your website balances your brand story and products or services. You target keywords to pages of your site, just like your jobs are targeted to certain functions and skill sets.
Which resume would you choose to interview for a Marketing Director?

A. “I’m Leroy, I’m awesome. I’m really cool, I enjoy long walks on the beach and like Ethiopian food.”

B. “Kevin is a seasoned marketing professional who has managed and implemented effective marketing promgrams.”

By the same token, which website would you do business with? One with “high quality products and synergistic solutions”? Or a site that speaks in plain, compelling English?
Your References
Your references are your backlinks, or 3rd party websites linking to your own. You can influence these endorsements and relationships, but not necessarily control them. On both sides of this comparison, quality trumps quantity.

Which of the following references holds the most weight for a candidate?

A. “Little Michael is my favorite nephew, he eats a lot at Thanksgiving, you should hire him.”

B. “Jake paid me some money to recommend him. I guess he’s cool.”

C. “Ryan took our marketing department to the next level with smart strategy. He works well with the team implementing our campaigns.”

Ryan is the best choice. A bunch of low quality or fake recommendations will do a job seeker little good if not harm. By the same token, it’s better to have a few excellent backlinks than a bunch of spammy or fake endorsements.
The ultimate goal
When you’re a job seeker, interviews are great. But you really want the career! Likewise, it’s great to rank well in the search engines, but you want new, loyal customers that convert on your website.

Above all else, optimize your website for your users. The search engine results will follow.

Where to next?

That’s how to explain and understand SEO in five minutes! Obviously, there’s much, much more to learn. However, this will get you on the right path. Dive deeper into SEO with a fantastic Beginner’s Guide from Moz.
DSC_0265 Zach Doty Cover Photo How to Win SEO Long Term

Winning Long Term SEO for Years

A few years ago, the average CMO tenure was 23 months. Yikes. That’s barely long enough to get acquainted and jamming with your staff. Happily, a recent indicates a CMO’s average tenure now sits at 45 months. It’s no secret that personnel and vendors come and go with the executive. For agencies and in-house digital marketers, burgeoning attention and spend in digital means unprecedented opportunity. Naturally, there is tremendous potential for fruitful, long term, agency-marketer-executive relationships. Yet success seems anything but simple, we can’t just ride off into the sunset. (Darn, I like Westerns.) Long term digital marketing engagements still seem precarious at best, especially for Search Engine Optimization (SEO). The “quick wins” and short-sighted quarterly business environment is still firmly entrenched. With a bit of work and love, long-term client-marketer-executive relationships can be profitable foundations that bolster your agency or brand for the next 10 years.

Succinctly, winning SEO for years is a bit like a strong friendship. It’s not perfect, but an active exchange of trust and vulnerability makes something great. It’s not always “up and to the right”. Every friendship is different, but there are guiding principles and helpful tidbits all can apply.

1. Be a Good Wingman: No Paid Links, period. Just don’t do it. More profound material that follows, but an astounding number of folks still buy crappy links. The alleged 3 month benefit isn’t worth your 5 or 10+ year relationship. Consider the latency of SEO: bad backlinks bought today probably won’t help much this quarter. However, they could be indexed in 1-2+ years and derail your campaign at a crucial moment. Because you’re a star marketer, you may find yourself explaining this to other. Less enlightened (don’t tell them that!) colleagues, staff and supervisors need to know that optimizing for the user, not the search engine, brings the win home. Provide an enchanting user experience, and results will follow. Bonus: If you want to scope out your link situation, check out Link Detox or use a great SEO software platform to audit your link profile quality.

2. Be a master of reporting and storytelling. A common agency story runs like this, stop me if you’ve heard this one before: 3 months into an engagement, the client loves the work, everyone is excited! 6 months: communication tapers off and so does the work. At 7-8 months, an email arrives, “Can we get an audit of our billings and work?” Next month, “We’re not seeing the value…can we talk?”

Learning to communicate and report intelligently will help you avoid the account/campaign death spin and 9at least) double the life of your engagement. How you say and show success is the lifeblood of your agency’s (or brand’s marketing) future. In agencies, you’ll often hear, “We don’t have time to educate the client.” True, but you surely can’t afford to leave them in the dark. Build small bits of education into your reporting at each step. Your client (or executive) should be educated enough that they could dispose of you, but so satisfied that they’ll never want to.

Reporting over a long time horizon is tricky. Before you have a full year of data, seasonality can make your work look bad if you’re uninformed on market trends. (What if your 6 month evaluation is in a demand trough?) Furthermore, it’s not realistic to primarily report on the same metric month after month. (E.g, keyword rankings) The client or executive may deem organic traffic the determining KPI at your campaign start. However, fascination is fleeting. Revenue or return on investment will likely be your KPI in 12 months’ time.

Use a consistent mix of metrics to paint a rich picture of your phenomenal digital marketing campaign. When you forecast, it’s common to use upper and lower bounds (like economists and weathermen!) to ensure you don’t look like too big of an idiot in any case. Similarly, use “upside metrics” such as revenue generated from organic and ROAS/ROI and “downside metrics” like cost per acquisition and results decay analysis if your client or executive stopped working with you. Assuming sound communication, your reporting should become easier over time. When showing CMO’s and presidents year-over-year, 3, 5 year trends of their performance, we don’t have to do much selling.

3. Learn to live through redesigns. The shelf life of a website is (and should be, to a degree) these days. Blanket statements are a great way to get in trouble. However, many sites (looking at you, Fortune 500 companies) are on the cusp of major changes for mobile friendliness. If you’re around for more than a couple of years, you will see the client’s site go through a redesign. Ideally, you will start the redesign process small pieces at a time. When you present conversion improvement data, mash up clickstream analytics with heatmapping data for compelling improvements.

However, if you’re not regularly testing, you should start. If you approach a redesign without aforementioned experience, here are a few things to keep in mind.

  • You must exercise discretion and attention to detail. Choose carefully which battles to fight. Web design & development projects are notorious for being past schedule, over budget and largely dissatisfying on the whole. Don’t be the unnecessary logo critic and save your clout for things that matter to SEO.
  • Here’s what you do need in a redesign: a seat at the table, the power to veto content, technical matters and the ability to test after completion. Conventional wisdom in design is at best, a starting point. Best practices will not transfer from one client to the next.
  • Here’s what you don’t need: Approval on typography, creative direction of promo tiles and so on. Did we mention you should pick your battles?

A redesign done well can bolster traffic, interest and conversions. A poor redesign can break a site, its rankings and the business behind it. Mind your technical details such as URL aliases, file extensions, redirects, robots files, sitemaps and more. Don’t know what I just rattled off? Send me a message, I’m happy to explain.

4. Visible Progress. Related to reporting, what tangible value can you demonstrate on a regular basis? Clients and executives often refer to digital marketing as “black box” and “murky”. Their perception is understandable. However, many facets of digital marketing are so precise and complex at scale that simple explanations are very difficult in quick meetings. What pieces of content or site changes can you point to? Given that digital is complex, your client or executive must have concrete, simple wins they can shop as their own.

5. Deep involvement in the client’s business. Don’t get left out in the cold. Many agencies suffer volatility because they enter late in the marketing game with a client. Brand managers suffer irrelevance by thinking small, too late. When a client or executive says sales or down, don’t nod and make a cursory note in your moleskin. Unleash a barrage of intelligent questions about their customer intelligence, acquisition, retention and sales process. Your ability to engage on a deep business level (down to P&L and EPS) will be a large determining factor in your long term success.

This is not an all-inclusive guide to winning SEO long term. However, it’s my hope that this will a jump off point for your team as it conquers its next digital marketing success.