About frans

Website:
frans has written 4625 articles so far, you can find them below.

A Guide to Sampling in Google Analytics

Posted by Tom.Capper

Sampling is a process used in statistics when it’s unfeasible or impractical to analyse all the data that exists. Instead, a small, randomly selected subset is used to keep things manageable. Many analytics platforms use some sort of sampling to keep report loading times in check, and there seem to be three schools of thought when it comes to sampling in analytics. There are those who are terrified of it, insisting in unsampled versions of any report. Then there are those who are relaxed about it, trusting the statistical logic. And then, lastly, there are those who are oblivious.

All three are misguided.

Sampling isn’t something to fear, but, in Google Analytics in particular, it can’t always be trusted. Because of that, it’s definitely worth your time to understand when it occurs, how it affects your work, and how it can be avoided.

When it happens

You can always tell when sampling is being used, because of this line at the top of every report:

If the percentage is less than 100%, then sampling is in progress. You’ll notice above that I’ve produced a report based on more than half a billion sessions without any sampling — sampling isn’t just about the sheer number of sessions involved in a report. It’s about the complexity of what you’re asking the platform to report on. Contrast the below (apologies for the small screenshots; I wanted to make sure the whole context was included, so have added captions explaining just what you’re looking at):

No segment applied, report based on 100% of sessions

Segment applied, report based on 0.17% of sessions

The two are identical apart from the use of a segment in the second case. Google Analytics can always provide unsampled data for top-line totals like that first case, but segments in particular are very prone to prompting sampling.

The exact same level of sampling can also be induced through use of a secondary dimension:

Secondary dimension applied, report based on 0.17% of sessions

A few other specialised reports are also prone to this level of sampling, most notably:

  • The Ecommerce Overview
  • “Flow Reports”

Report based on 0.17% of sessions

Report based on <0.1% of sessions

To summarise so far, sampling can happen when we use:

  • A segment
  • More than one dimension
  • Certain detailed reports (including Ecommerce Overview and AdWords Campaigns)
  • “Flow” reports

The accuracy of sampling

Sampling, for the most part, is actually pretty reliable. Take the below two numbers for organic traffic over the same period, one taken from a tiny 0.17% sample, and one taken without sampling:

Report based on 0.17% of sessions, reports 303,384,785 sessions via organic

Report based on 100% of sessions, reports 296,387,352 sessions via organic

The difference is just 2.4%, from a sample of 0.17% of actual sessions. Interestingly, when I repeated this comparison over a shorter period (last quarter), the size of the sample went up to 71.3%, but the margin of error was fairly similar at 2.3%.

It’s worth noting, of course, that the deeper you dig into your data, the smaller the effective sample becomes. If you’re looking at a sample of 1% of data and you notice a landing page with 100 sessions in a report, that’s based on 1 visit — simply because 1 is 1% of 100. For example, take the below:

Report based on 45 sessions

Eight percent of a whole year’s traffic to Distilled is a lot, but 8% of organic traffic to my profile page is not, so we end up viewing a report (above) based on 45 visits. Whether or not this should concern you depends on the size of the changes you’re looking to detect and your threshold for acceptable levels of uncertainty. These topics will be familiar to those with experience in CRO, but I recommend this tool to get your started, and I’ve written about some of the key concepts here.

In extreme cases like the one above, though, your intuition should suffice – that click-through from my /about/ page to /resources/…tup-guide/ claims to feature in 12 sessions, and is based on 8.11% of sessions. As 12 is roughly 8% of 100, we know that this is in fact based on 1 session. Not something you’d want to base a strategy on.

If any of the above concerns you, then I’ve some solutions later in this post. Either way, there’s one more thing you should know about. Check out the below screenshot:

Report based on 100% of sessions, but “All Users” only accounts for 38.81% “of Total”

There’s no sampling here, but the number displayed for “All Users” in fact only contains 38.8% of sessions. This is because of the combination of there being more than 1,000,000 rows (as indicated by the yellow “high-cardinality” warning at the top of the report) and the use of a segment. This is because of the effect of those rows grouped into “(other)”, which are hidden when a segment is active. Regardless of any sampling, the numbers in the rows below will be as accurate as they would be otherwise (apart from the fact that “(other)” is missing), but the segment totals at the top end up of limited use.

So, we’ve now gone over:

  • Sampling is generally pretty accurate (+/- 2.5% in the examples above).
  • When you’re looking at small numbers in reports with a high level of sampling, you can work out how many reports they’re based on.
    • For example, 1% sampling showing 100 sessions means 1 session was the basis of the number in the report.
  • You should keep an eye out for that yellow high-cardinality warning when also using segments.

What you can do about it

Often it’s possible to recreate the key data you want in alternative ways that do not trigger sampling. Mainly this means avoiding segments and secondary dimensions. For example, if we wanted to view the session counts for the top organic landing pages, we might ordinarily use the Landing Pages report and apply a segment:

Landing Pages report with Organic Traffic segment, based on 71.27% of sessions

In the above report, I’ve simply applied a segment to the landing pages report, resulting in sampling. However, I can get the same data unsampled — in the below case, I’ve instead gone to the “Channels” report and clicked on “Organic Search” in the report:

Channels > Organic Search report, with primary dimension “Landing Page”, based on 100% of sessions

This takes me to a report where I’m only looking at organic search sessions, and I can pick a primary dimension of my choice — in this case, Landing Page. It’s worth noting, however, that this trick does not function reliably — when I replicated the same method starting from the “Source / Medium” report, I still ended up with sampling.

A similar trick applies to custom segments — if I wanted to create a segment to show me only visits to certain landing pages, I could instead write a regex advanced filter to replicate the functionality with less chance of sampling:

Lastly, there are a few more extreme solutions. Firstly, you can create duplicate views, then apply view-level filters, to replicate segment functionality (permanently for that view):

Secondly, you can use the API and Google Sheets to break up a report into smaller date ranges, then aggregate them. My colleague Tian Wang wrote about that tool here.

Lastly, there’s GA Premium, which for a not inconsiderable cost, gets you this button:

So lastly, here’s how you can avoid sampling:

  • You can construct reports differently to avoid segments or secondary dimensions and thus reduce the chance of sampling being triggered.
  • You can create duplicate views to show you subsets of your data that you’d otherwise have to view sampled.
  • You can use the GA API to request large numbers of smaller reports then aggregate them in Google Sheets.
  • For larger businesses, there’s always the option of GA Premium to receive unsampled reports.

Discussion

I hope you’ve found this post useful. I’d love to read your thoughts and suggestions in the comments below.


Sign up for The Moz Top 10, a semimonthly mailer updating you on the top ten hottest pieces of SEO news, tips, and rad links uncovered by the Moz team. Think of it as your exclusive digest of stuff you don’t have time to hunt down but want to read!

Continue reading →

Storytelling 301: Site Content as Story

Posted by Isla_McKetta

Feel like you’re already over the term “storytelling” without ever really having understood how you can successfully apply it to your writing? You aren’t alone. Like so much jargon, this amazingly powerful and useful word is in serious danger of being consigned to LinkedIn profiles and marketing parody.

Even storytelling guru Annette Simmons is over the way we’re teaching storytelling as a content cure-all.

“We need to stop ‘telling stories’ that oxytocin or the magic of a ‘narrative arc’ explain storytelling. It’s much bigger than science can explain. Storytelling is an art – subjective, emotional, and as variable as humanity is diverse.” – Annette Simmons

We can do better. Instead of yet another “stories=good” post, today we’re going to apply the logic of storytelling to site content. After you’ve read the last word, you should have the tools you need to draw a concrete map of how to tell your brand “story” with site content.

Note: I’m not knocking storytelling here. I’m a novelist. That’s illegal. I am knocking throwing the latest buzzword at our marketing and pretending like using the word makes us better at our jobs.

Why storytelling

I promised not to flog you with the “stories are engaging so be engaging by telling stories” line, but if we dig just a little deeper we can understand one of the concrete arguments for storytelling: persuasion.

In her compelling book, The Story Factor, Annette Simmons reminds us that we can throw facts and figures at people all day long, but stories hold the real power to change someone’s mind.

“Your story needs to take [potential customers] on a tour of the aspects that step by step convinced you to believe so they can step by step come to believe the same things” – Annette Simmons

Take a moment to check this against your own experience. When was the last time someone truly shifted your perspective? If they did so using anything other than a story, it’s okay to stop reading here and find a tactic that you think will work better. But my guess is that some sort of story was involved.

The six types of story

Simmons outlines six types of stories we can use as humans and marketers to overcome objections:

    “Who I am” stories and “why I am here” stories establish the groundwork you need to build trust with your audience. They naturally assume you’re in it for yourself and these stories allow you to share your motivations. If you get human enough, your audience might find common ground on which to connect with you.

    Vision stories tell how things could be. This type of story shows your audience what’s in it for them. If you’re holding an all-hands meeting, your vision story might include a tale about how the company has triumphed over obstacles in the past. If you’re marketing a product, your vision story might speak to a future state where a problem (that your product solves) no longer has to exist.

    Teaching stories give your audience an opportunity to learn from a mistake without ever having to make it. They also help you shape that audience’s understanding of the potential solutions available to them. For example, if I were to tell you that a site audit can help you understand all the content resources you have available to you and use Moz Content as my auditing tool, I’d be pointing you in the direction of a solution for you and also making it easy for you to choose our solution.

    Values-in-action stories are similar to vision stories and teaching stories, but they focus on the core values you want to reinforce and provide examples. Simmons suggests focusing on positive value stories rather than “war stories.” One way to do this would be if a wedding dress company that prided itself on proper etiquette wrote a blog post about a bridal consultant who hand-wrote a thank-you card to every bride who purchased a dress from her.

    The final type of story, the “I know what you are thinking” story, allows you to neutralize concern without that concern ever being raised. It’s relatively easy to anticipate an objection from your audience and to use this kind of story to get ahead of it.

    Applying storytelling to site content

    This is where I wish I had a gorgeous illustration of the marketing funnel and that I could neatly fit these six story types in and presto change-o, poof! Your site content is perfectly optimized for storytelling and conversion.

    Alas, life is a little harder than that. But we can get a good sense of which types of content are best for telling which types of stories. I’ll use Moz as an example because that’s close to my heart.

    Who we are and why we’re here

    Moz is about three things: helping people be better marketers, building a strong community, and being TAGFEE. Free educational content has been a huge part of who we are since the very beginning when Rand was blogging about everything from the Google Link Command to Sandbox. That strong community is here because all of you make it happen, and because we work to make TAGFEE happen every day.

    You can see our desire to help people be better marketers and to connect with the community right up at the top of our site. Click on “Learn & Connect” to bring down a bucket of resources like our beginner’s guides to SEO, Content Marketing, and Social Media, as well as our webinars, blog, and Q&A.

    We also share who we are on our about, TAGFEE, and team pages.

    You’ll note that all of this content is front and center because it helps our audience get to know us. Our audience becomes acquainted with our slightly quirky personality through our voice and the style of our imagery. We put our values out in the open for all to see so we can hold ourselves accountable and so our audience can know what to expect. And you can tell a lot about Moz by the fact that everyone who wants to be is listed on our team page (not just a selection of the top execs) and that each individual Mozzer’s page has their own voice.

    Help your potential customers get to know you by sharing “who you are” and “why you’re here” stories in the content and form of your home, about, and team pages.

    Our vision

    The homepage is a perfect place to introduce an audience to your vision story:

    But to really shape their expectations about what life could be like if only they’d use your products, you’ll want to flesh out that vision story in content such as product descriptions and white papers.

    Notice that all the vision stories, no matter where they are on the site, elaborate on and reinforce the same vision. Some pieces will speak to a greater ecosystem and others will pinpoint how your products bring that vision to life. Which role they play depends largely on where that piece of content sits in your funnel.

    Teaching

    You’re reading teaching story content right now. I’m not trying to sell you anything at all, but I am trying to give you a new way of thinking about the work you do — to help you make better marketing. I’m also, on a meta level, teaching you about how Moz thinks about marketing, including how we see value in going beyond superficial monikers like “storytelling” and “keywords” to provide actual applied insight.

    Although I mentioned our beginner’s guides as “who we are”-type stories, they are also teaching stories. You may have noticed that we don’t have a beginner’s guide to pay-per-click advertising. That’s not because PPC isn’t important, but it is because our story is about the difference you can make with SEO, content marketing, and influencer marketing.

    Big content can also be part of your teaching story. We use our Search Ranking Factors and Local Search Ranking Factors surveys to explore and share the changing nature of search, which helps focus our potential customers on asking the right questions about ranking better (instead of “where can I buy links?”).

    Mozcast plays a similar role by pointing people’s attention to potential signs of shifts in Google’s search algorithm. It is a useful tool, yes, for monitoring and predicting the search climate. It’s also a story that teaches how much the algorithm changes and that SEO is not a one-and-done project.

    Depending on who you are, your teaching stories might help your audience see fashion from the lens of accessories, understand that the value of your products is in sending matching items to the developing world, or see how essential connection speed is to saving money. Shape that conversation on your blog and in your big content.

    Values in action

    Our blog also tells values in action stories. We do this both through the teaching that is so core to who we are but also through the tone of content on the blog. This goes back to TAGFEE. Rarely (if ever) will you see a brand or competitor called to the carpet on our site. And our product and company updates are just as likely to tell you the ugly side of why we made the improvement as they are to celebrate the update, like this announcement of Keyword Explorer:

    You’ll also find values in action stories in our help documentation as we try to provide straightforward but fun information to help you be the best marketer you can be.

    Demonstrate your values in action by telling the story of efficient project management with a datasheet that doubles as a purchasing checklist to help your buyer overcome internal objections. Or teach your customers how to use the spices you sell by turning help documentation into recipes.

    We know what you are thinking

    Wow, that’s a lot of talk about us. Most of our audience would be wondering right now if we can really live up to that hype. That makes this the perfect moment to share a “we know what you are thinking” story. Some of the best site content forms for putting the proof in your pudding are social proof (in the form of testimonials) and case studies.

    Your turn

    Ready to put storytelling into your site content? The framework is universal, but the application of it will be very individual to your experience. I’d love to hear how you’ve incorporated these six types of stories into your site, along with what’s working for you and what isn’t.


    Sign up for The Moz Top 10, a semimonthly mailer updating you on the top ten hottest pieces of SEO news, tips, and rad links uncovered by the Moz team. Think of it as your exclusive digest of stuff you don’t have time to hunt down but want to read!

    Continue reading →

    Why I’d Recommend Local SEO as a Promising Career for Millennials

    Posted by MiriamEllis

    The Palace of Fine Arts in San Francisco. Image courtesy of Mike Behnken on Flickr.

    The civics of local: Caring about your community

    From Golden Gate Park in San Francisco to Central Park in New York City, with all of the town greens, plazas, fountains, schools, and libraries in between, America’s lasting community resources stand as a testament to our civic-minded past. Town fathers, city boards, and citizens of former times dedicated themselves to enriching local life by creating public access to features that fostered identity, civic pride, and a higher standard of living.

    Modern cynics might look at today’s cityscapes and conclude that city planners have forgotten the need for accessible human resources. Sprawling housing developments without parks, whole districts without adequate shopping, good schools, libraries, or community centers would be evidence of this. And yet, 2016 points at a better future because, if nothing else, the ongoing election cycle has proven that the rising workforce — the millennial generation — cares tremendously about civics.

    In the phenomenal youth movement currently sweeping the nation, I see an inspiring, fresh commitment to improving life for all people and all communities. If you’re one of those citizens rallying for a living wage, greater educational opportunities, and the revitalization of both inner city and rural life, then this article will explain why a career in local search marketing could spell out satisfying work that directly impacts life quality in communities across the country. In other words, your best ideals will go hand-in-hand with what you do for a living. Sound good? Let’s take a look!

    What is local search marketing, in a nutshell?

    Anything you do to promote the online visibility of local businesses, organizations, and resources = local search marketing. Local search engine optimization (SEO) basically seeks to create a mirror image of real-world communities on the web, making it easy for anyone to find the best available resources for everything nearest them. You can promote the visibility of local businesses, schools, parks, organizations, churches, or anything else that exists for the use of people in any given city or town.

    Local SEO seeks to reflect real-world communities. Image courtesy of DonaldMcTim on Flickr.

    The basic components of local

    Right now, the basic components of local search marketing include:

    • Designing locally optimized websites
    • Developing locall -relevant text, image, and video content
    • Building local business listings on a variety of search engines and directories
    • Helping clients earn and manage online reviews
    • Helping clients engage with their neighbors via social media
    • Ensuring that all client holdings are mobile-friendly
    • Seeking local publicity opportunities, whether via news, advertising, sponsorships, or other vehicles
    • Discovering innovative methods of helping your clients stand out from the competition

    Here’s a broad overview of local SEO to jump-start your education. Ready for a deep dive? You can get a detailed picture of the major components of local search marketing from this Local SEO Checklist, and can take a gander at what industry experts cite as the most influential Local Search Ranking Factors you’ll be implementing for clients.

    Manual + automated solutions

    Local search marketing has been a viable career option for a little over a decade — ever since search engines like Google set out to replace the print Yellow Pages as the way people access local resources. In the early days, a majority of the work we did in local was manual — manual website development, manual local business listing creation, etc. Now, many tasks have been made easier via tools.

    Google: Making print phone books obsolete for over a decade. Image courtesy of Mike Goehler on Flickr.

    For example, you don’t have to build a website from scratch. You can learn to develop excellent Wordpress-based websites, choosing from mobile-friendly/responsive themes and using plugins that make it easy to incorporate basic local optimization components.

    You don’t have to build local business listings (a.k.a. “citations”) one at a time anymore, either. You can use automated tools or sign up for manual submission services, freeing you up for more creative work.

    Intelligent tools now make it possible to analyze your social media opportunities and manage your review strategy.

    You’ll be entering the field at a time when tools have taken quite a bit of the grunt work out of this area of marketing, meaning your best asset may be your creativity, rather than your capacity to grind through things.

    Go solo or work for an agency

    Before you take a job or start serving clients, you’ll want to educate yourself as much as possible about this form of marketing. Your education will prevent you from going to work for an agency that doesn’t adhere to above-board practices, and it will also lessen your chances of making a costly mistake for your clients.

    Working from home can be quite cozy. Image courtesy of Tina Lawson on Flickr.

    You can set up your local SEO business in your living room, if need be, with nothing more than a laptop and a good Internet connection. Some people have no problem flying solo, beginning the work of making a name for themselves by their contributions to their own community and the local search marketing industry. The main benefit of this is autonomy; the main drawbacks are money worries until you get established.

    Others may prefer to seek employment at an agency with an existing local SEO department. Some companies will only hire you if you’ve got proven experience, but if an agency is open to interns, this can provide a great opportunity to learn on the job and understand what it means to be part of a team. The main benefits of this are experience and a regular paycheck; the main drawback is less direct control over the work you’d like to explore.

    Emotional requirements of the job

    Here’s a simple checklist that should help you determine whether you’ve got the right temperament for the job. You’ll need to:

    • Be a self-disciplined worker (especially if you’re going solo) but also be open to the benefits of a more flexible schedule. Some of the best Internet marketing agencies aren’t rigid about 9–5 work days and allow for some work being done outside the office. Some modern businesses are experimenting with concepts like the 6-hour work day and other new ideas. On your own, you may find yourself working 5 hours a day — or 15! Flexibility is an asset in this field.
    • Have good communication skills. You’ll be strategizing with team members and distilling complex topics down into easily understood terms for clients. You’ll be well-served by the ability to speak well and clearly with anyone you meet in a day’s work.
    • Feel empathy. Local SEOs should be able to identify with their clients’ struggles, whether they are mom-and-pop shops in neglected communities or large brands floundering over their identity. You become a part of every business you serve and will have a share in both failures and triumphs.
    • Practice awareness of your own experience with commerce. Approach every one of your own transactions from the viewpoint of both merchant and consumer and analyze faults and successes. No part of commerce is too small to be analyzed, and your findings will give you something to think about, write about, and put into practice for clients.
    • Love a mystery. When a business is failing to rank, when an incoming client might be spamming search engines, when Google tweaks its algorithm, or outreach is falling on deaf ears, you will be the detective who gets to the root of the problems and defines the solutions.
    • Like to travel + network. While it’s not necessary for local SEOs to serve clients in person, chances are good that you’ll want to travel to industry events, and hopefully one day contribute to them for the educational advancement and prestige of your business or agency. Word-of-mouth is regularly cited as one of the most effective vehicles for client acquisition, so the more people with whom you network in local, the better the health of your company.
    • Be honest when it counts most. You can’t fear civil confrontation in this field. It’s pretty much guaranteed that you’re going to have to deliver bad news to confused clients and lay down the law to spammy ones. You’ll be required to be totally honest when what a client has been doing is harming their own business. That’s your job, and it’s only when you’ve called out and halted bad practices that you can begin to implement better ones. You’ll also need to honest with agency team members about your work, progress, and concerns.
    • Commit to continuing education. There may be no other form of Internet marketing that has experienced more changes in the past decade than local. Guidelines and tactics change on a continual basis and, as a local SEO, it will be your job to keep up with all such developments. Your education must be viewed as ongoing as long as you’re in business.

    What does a job in local SEO pay?

    No promises on the emeralds and pearls! Image courtesy of Leigh49137 on Flickr.

    According to the 2015 BrightLocal industry survey, the average annual income for SEOs (pre-taxes) was $70,000 and the median income was between $50,000–$60,000. How these figures strike you will largely depend on the cost of living in your geography. These earnings may not be adequate if you live in San Francisco or NYC, but may be just fine if you make your home in Albuquerque or Atlanta.

    Note, too, that these are averages, and that there’s room in this industry for innovators to work their way towards greater earnings. Remember, it was your generation that produced Mark Zuckerberg who founded Facebook when he was 20.

    In the local SEO industry, there have been success stories like David Mihm’s $3 million sale of his local business listing product, GetListed, which became the foundation of Moz Local. While not every worker in this discipline will “make it big,” no limit can be placed on your potential to succeed if you have the ability to discern opportunities that haven’t yet been explored to their limits. If you’ve been gifted with a great brain, it could be your company that invents the next app, software, or platform that lights up the local landscape.

    Recommended skill acquisitions

    Even as I’m writing this, local is out there changing and developing, so the best I can provide newcomers is a snapshot in time of the skills I’d recommend they acquire right now to be current + competitive:

    Master the guidelines for representing your business on Google

    As a local SEO, these are your rules for survival and contain the essential mindset you’ll bring to almost every interaction you’ll ever have with any client or team member. The guidelines are regularly revised, so check back periodically for edits that may totally change the game.

    Learn PPC

    Google, the biggest force in local, is steadily but surely moving towards more highly-monetized local search engine results. The local SEO of today and tomorrow will need to be able to advise clients about pay-per-click and other forms of advertising. Here’s a beginner’s guide to Google Adwords. We have a Pay-Per-Click category here on the Moz blog and you’ll enjoy this Phil Rozek article written about his 8 years of doing PPC for local businesses.

    Engineering/dev skills could set you apart

    You can stick to being a consultant if you prefer, but it can be a major asset if you know how to get in amongst the nuts and bolts of websites, applications, and widgets. In fact, your abilities as a developer could be a key to you moving from basic income to lucrative innovation.

    Learn offline local marketing

    Local SEO doesn’t exist in an online vacuum. It represent the real commercial and civic landscape we all inhabit. Understanding traditional forms of offline marketing (think print marketing, newspapers, billboards, radio, TV, etc.) will make you a much stronger force in the field. Most businesses will need to employ a combination of both on- and offline publicity, and you’ll need to be in-the-know about all of it.

    Learn a second language

    Having trouble breaking into the industry? Being bilingual could help. In the U.S., learning Spanish will help you serve the skyrocketing Hispanic business community. In Canada, learning French could be a real help to your agency. In Europe, pick the language of any neighboring country that has the infrastructure to benefit from local SEO and double your client base. In Australia, you might tackle Mandarin to serve business owners both at home and abroad. Despite working in something called “local,” ours is a global economy!

    Follow the leaders

    Finally, I’d recommend that you make a commitment to follow industry leaders’ blogs and social profiles, as an essential part of your education and daily work. Local is an exceptionally generous area of marketing, with experts willingly sharing tons of useful information on a daily basis. We strive to offer some of the most comprehensive coverage and tutorials in the local SEO column here on the Moz Blog, and I would further recommend these high-quality resources:

    That’s a short list, and you’ll likely find many more smart people to learn from and network with. The main thing is to set yourself a regular schedule of checking resources like these for the latest local developments.

    What a meaningful worklife feels like

    The average American works 1,700 hours a year. If you start working when you’re 16 and retire when you’re 75, you’ll be spending over 100,000 hours of your life on the job. 100,000 hours.

    If you had a choice, chances are, you wouldn’t sign up to spend that much time doing anything that felt meaningless to you. If you had a choice, chances are you’d much rather get to put some of your personal hopes, ethics, and best self into those future hours ahead of you.

    In your spare time, you’ll be socializing with friends, maybe caring for a spouse and raising a family, maybe volunteering on the local school board, or in community projects, social, environmental, or political causes. What if time away from the things you love best could actually go towards improving the usefulness and accessibility of the cities you and others live in?

    Image courtesy of Tobias Berchtold on Flickr.

    And that’s why I’d recommend local SEO as a work option for young people. It truly can be meaningful when you help a senior center get found by your friend’s grandmother who never knew before that she could take a free class in sociology. Or when you help a family-owned restaurant make the front page of the local newspaper with their blue-ribbon organic tacos. Or when you help main street compete against the big-box stores, keeping your community unique.

    That’s what local search marketing can be, and it can make the difference between a job you couldn’t care less about, and one that is integrated with the interesting, meaningful life you want to build for yourself. When you’re equipped with the skills to get businesses, organizations, and local stories heard, when you have the necessary education and have a say in picking the voices you want to amplify, you will never lack for opportunity to lend a powerful helping hand to the civic improvements you feel matter most.


    Sign up for The Moz Top 10, a semimonthly mailer updating you on the top ten hottest pieces of SEO news, tips, and rad links uncovered by the Moz team. Think of it as your exclusive digest of stuff you don’t have time to hunt down but want to read!

    Continue reading →

    The Search Marketer&rsquo;s Guide to ItemRef &amp; ItemID

    Posted by Mike_Arnesen

    Structured data has never been more important than it is today. We’ll talk about why briefly below, but that’s not what this post is about. This post is about giving you a new tool to add to your semantic SEO tool belt. My goal is to empower you implement semantic markup and structured data with greater ease and enable you to architect a more robust and complete web of linked data on your website (and beyond).

    Structured data is more important than ever

    I don’t think that’s an exaggeration. When Schema.org launched in June of 2011, search marketers gained access to an incredibly powerful tool: an extensive vocabulary, agreed upon by the world’s leading search engines, with which we could give our data meaningful structure.

    However, there were two things holding us back from realizing the dream of a truly semantic web.

    1. The difficulty of actually implementing said markup on our sites.
    2. The markup’s limited utility in actually achieving some kind of tangible SEO return on our investment.

    I believe JSON-LD’s big day at Google was a watershed moment in making implementation less daunting and, hopefully in the coming years, ubiquitous across the web (well, at least more so). Now that we have rapidly growing JSON-LD support from Google and powerful semantic attributes like Itemref and Itemid, the ability to give structure to the unstructured is within everyone’s reach.

    The tangible SEO return has also never been greater! Beyond tried and true rich snippets for star ratings, pricing, availability, and breadcrumbs in search, we’re seeing richer and richer results, previews, and cards show up in Google. These are powered by, you guessed it, structured data and, more often than not, the recommended format is in JSON-LD. In light of Google’s recent launch of Rich Cards (starting with Recipes and Movies, but sure to be expanding to other Schema types soon), Top Stories with AMP, and Knowledge Panel Critic Reviews (which is currently by request and with Google approval only), we need flexible models for structuring bigger and bigger data sets.

    Through using itemref and itemid, you’ll be able to mark up your data that much easier to keep up with the rapid evolution of semantic SEO. You’ll also be positioned to fully capitalize on new search features, regardless of whether or not they require JSON-LD or in-line microdata (remember that while Google is now all about JSON-LD, they’re not the only game in town).

    That’s enough of an intro; let’s talk itemref and itemid.

    What are itemref & itemid?

    At their core, itemref and itemid are just HTML attributes. They’re actually very similar to other attributes that you’re already familiar with if you’ve worked with semantic markup before.

    The 3 most common attributes in semantic SEO

    Let’s quickly recap what itemscope, itemtype, and itemprop do. Feel free to skip to the next section, though it never hurts to brush up.

    Itemscope: an attribute without a value that defines the scope of an semantic entity within your data. Everything within that itemscope is considered a part of that entity and everything outside of it is separate.

    <div itemscope></div>
    

    Itemtype: an attribute that goes hand-in-hand with itemscope and that does have a value. The value of the itemtype attribute is going to specify the type of entity you’re marking up and is most commonly a link to a URL on schema.org.

    <div itemscope itemtype="http://schema.org/Person/" ></div>
    

    Itemprop: an attribute used to declare specific attributes of your entity (e.g. itemprop= “name”, itemprop=”description”, etc.)

    <div itemscope itemtype="http://schema.org/Person/" >
        <h1 itemprop="name">Mike Arnesen</h1>
    </div>
    

    The 2 hidden attributes in semantic SEO

    It’s fairly easy to guess what itemref and itemid are just by looking at their names, but it’s a little harder to figure out how to use them (don’t worry, we’ll get to that part later).

    Itemref: an attribute that allows you to reference other data points outside of the itemscope.

    <div itemscope itemtype="http://schema.org/Person/" itemref="phone" ></div>
    

    Itemid: an attribute that allows you to give an entity a unique identifier. This entity can then be used to flesh out another entity as an embedded entity.

    <div itemid="http://www.upbuild.io/#upbuildOrg" 
    itemscope itemtype="http://schema.org/Organization" ></div>
    

    But why do we even need these?

    The challenge with inline markup

    The challenge we face with inline microdata is that it’s brittle and breaks easily. It’s also very rigid in terms of implementation. Itemref and itemid help us overcome that!

    Consider the page below:

    inline-microdata-is-rigid.png

    The primary entity that you want to mark up on this page is a Product, but you’ll likely want to mark up the BreadcrumbList as well. Assuming that each highlighted area lives in its own <div> tag, you have some potential issues.

    1. If you declare your itemtype=”product” on the overarching <div> that contains all three areas, you forfeit the opportunity to mark up breadcrumbs. Why? Because a BreadcrumbList isn’t a valid a property of a Product.
    1. If you declare your itemtype=”product” on the blue <div>, you can still mark up the breadcrumbs on the red <div>, but you won’t be able connect the data in the green <div> to your main Product and your structured data won’t validate since offers (AKA, the price) is required.

    Traditionally, you’d have a make a non-ideal compromise or have a developer change how the whole page was structured. There’s no way around it; that sucks!

    How itemref and itemid empower you

    With itemid and itemref, you can write semantic markup that reaches across disparate <div> tags and pulls in the data points you need without requiring any restructuring.

    So what’s the difference between these two tags and when do you use one over the other?

    • Use itemref when you need to populate itemprops in your primary entity. For example, if the commentCount of a blog post was written in a <div> outside of the main post’s body.
    • Use itemid when you need to populate itemprops where the expected type (more on expected types from Schema.org) is another entity (not just a simple data point). For example, if you wanted to declare the publisher of a blog post, you’d want to point to a complete Organization entity (complete with a name, logo, URL, and perhaps even founder, address, contact points, etc.)

    How to use itemref

    An easy way to conceptualize the use of itemref is to imagine connecting a data blob to the semantic entity you’re working on. I first heard the term “data blob” from Jarno van Driel, someone who I’d consider my Itemref and Itemid Sensei, and I think it’s a fitting description.

    Data blob

    noun | ˈdā-tə- bläb

    a blob of data that just hangs around doing nothing special, until it’s called into service by another entity. More formally, a discoverable resource within a document.

    Screen Shot 2016-06-29 at 1.58.41 PM.png

    To keep this brief, let’s assume you’ve already marked up your Primary Entity to the best of your ability and, for the purposes of demonstration, let’s say we’re marking up a blog post (AKA, BlogPosting). Furthermore, let’s say that the one itemprop data point we can’t get at using traditional means is the commentCount for the blog post; it’s in a <div> that’s completely outside the scope of the blog post’s body.

    Screen Shot 2016-06-29 at 1.57.38 PM.png

    In order to solve this, we’ll want to mark up the commentCount as a data blob that contains an unlinked and unused commentCount property. There are three main steps:

    Step 1: In the <div>, <span>, or other HTML element that contains the commentCount, add an itemscope attribute. That’s it. In a deviation from the norm, you don’t want to follow that by specifying an itemtype. That’s why it’s called a data blob; it’s independent data without a type. In fact, when you eventually test this in Google’s Structured Data Testing Tool, you’ll see it pick up on an “Unspecified Type.” That’s fine; just ignore it.

    Screen Shot 2016-06-30 at 2.07.28 PM.png

    The finished tag should look like this:

    <div itemscope>...</div>
    

    Step 2: Wrap a new <span> tag around the comment count itself and specify what itemprop this is going to be. At this point, it’s a property of nothing and that’s okay.

    Now the finished tag should look like this:

    <div itemscope>
        <span itemprop="commentCount">108</span>
    </div>
    

    Step 3: Lastly, you’ll want to create a unique identifier for this data blob (so you can reference it later). To do that, just add a basic id to the tag.

    The updated tag will look like this:

    <div itemscope>
        <span itemprop="commentCount" id="comments">108</span>
    </div>
    

    Sidenote: Can Itemref Be Used with Meta Tags? Yes! Just go through Step 2 and Step 3 on meta tags in your <head> and you can reference them from an entity in your <body> tag using itemref! However, with meta tags there’s no need to add an itemscope; skip Step 1.

    Now we come to my favorite part: hooking the data blob into the main entity. It’s incredibly simple.

    Step 4: Find and edit the itemscope/itemtype declaration for your Primary Entity. In this case, it’ll look like this:

    <div itemscope itemtype="http://schema.org/BlogPosting">
    

    Step 5: Within that tag, add the itemref attribute and reference the unique id that you created in Step 3 above.

    The finished tag will look like this:

    <div itemscope itemtype="http://schema.org/BlogPosting" itemref="comments">
    

    Bonus: You can reference more than one data blob in the same itemref attribute! Just add them one after the other, separated by spaces.

    E.g., itemref=”comments wordcount citation alternativeHeadline”

    Boom! Now you’re cooking with itemref! Where before you had a pantry full of data that didn’t really go together, now you have an entity that is completely baked and you’re ready to roll.

    Screen Shot 2016-06-29 at 3.23.21 PM.png

    How to use itemid

    Using itemid is actually very similar and may even involve less new code than itemref. Since you use itemid when you want to reference another complete entity, this might be an entity that’s already on the page. If that’s the case, you just add a quick bit of markup and you’re good to go.

    In the visual below, what we want to do is use the Secondary Entity to populate an itemprop of the Primary Entity.

    Screen Shot 2016-06-29 at 2.52.34 PM.png

    Using our blog post example, let’s say we want to reference an Organization entity to populate the publisher itemprop of the BlogPosting entity.

    Screen Shot 2016-06-29 at 2.52.41 PM.png

    Here’s how we do that:

    Step 1: Mark up the Secondary Entity just as you normally would. If you already have that entity on your page and it’s fully marked up, that’s less work for you!

    Step 2: In the opening itemscope/itemtype declaration of that entity, add an itemid attribute and give this secondary entity a unique fragment identifier.

    It should look like this:

    <div itemid="#mozOrg" itemscope itemtype="http://schema.org/organization" >...</div>
    

    And now we make the magic happen!

    Step 3: Within your Primary Entity, add a <link> tag wherever you want to call in the Secondary Entity and specify the itemprop you want your Secondary Entity to populate. Use a simple href attribute to point to the fragment identifier from Step 2.

    It should look like this:

    <div itemscope itemtype="http://schema.org/blogPosting"> 
        <link itemprop="publisher" href="#mozOrg"/>
    </div>
    

    Bonus: You can reference this secondary entity from multiple other entities and populate multiple itemprops, too! If this post were a company announcement on moz.com and Moz were both the publisher and the author, both of those properties could reference #mozOrg.

    That’s it! Now, regardless of where these two entities live in the DOM (i.e., in your page’s source code), they’ll be linked together and can create something awesome.

    “By your powers combined, I am a great blog post!”

    Screen Shot 2016-06-29 at 3.11.39 PM.png

    Extending the power of itemid to JSON-LD

    I can hear some readers asking, “The days of microdata are over! Now that Google’s going to support JSON-LD for everything, who cares?”

    First, Google isn’t the only game in town and they don’t yet support JSON-LD for all Schema.org types (but, honestly, I think they will soon). That said, I still think it’s good practice to continue implementing structured data that less evolved crawlers can use.

    Second, even though itemref can’t be used within the JSON-LD data model, itemid most definitely can, although in JSON-LD the property is called @id! And boy, does it come in handy.

    Let’s talk about why you would use this and then we’ll get into how.

    Why @id is great with JSON-LD

    The why is pretty straightforward — just like when you’re using microdata, you are likely to have multiple JSON-LD entities on your site and, quite frequently, these will be housed in different scripts in the source code (or in different tags delivered via a tag management tool). Using @id, you can maintain your JSON-LD for each semantic entity separately and just make references between each entity as needed.

    For example, consider the blog post you’re currently reading which has structured data for a BlogPosting delivered in JSON-LD. You could avoid having to include all the data for your publisher (the Organization known as Moz) in your JSON-LD script and instead reference a dedicated JSON-LD script for it.

    You could host two independent JSON-LD scripts in your page <head> and link them using @id.

    Screen Shot 2016-06-29 at 3.55.10 PM.png

    In this example, using @id is more cool than useful; it doesn’t save that much time or effort. In fact, it’ll add a bit more code to the page if you’re including two separate JSON-LD scripts (for a BlogPost and an Organization) on every page rather than doing it all in one tag.

    Dealing with repetition

    But what about when a single entity can be used to populate multiple properties in your JSON-LD? That’s where @id could save you a ton of time and hassle.

    Imagine you have an Article page where you want to include structured data about the article’s publisher (#publisher), a video pertaining to the article (published by #publisher), and the article’s author (who worksFor #publisher). Suddenly, having the ability to leverage a single definition of the Publisher entity is very valuable!

    Going deeper

    If you’re not already sold on @id yet, here’s where it gets crazy. When you use @id with JSON-LD, you can extend its utility massively.


    You can use @id in a JSON-LD script to reference
    entities on other pages and even other websites!


    Let that sink in.

    Screen Shot 2016-06-29 at 4.11.50 PM.png

    What this means is that you can deliver JSON-LD on every blog post that references an Organization JSON-LD tag on the homepage. You don’t need to repeat that data on each page or update every instance if a datapoint ever changes.

    Here are just a few use cases in which you’d want to host JSON-LD for specific entities in centralized locations and reference them throughout your whole site.

    • Hosting your Organization JSON-LD on your company homepage and then using it as:
      • The publisher property on BlogPostings
      • The worksFor property on Person (on your team profiles)
    • Hosting Person JSON-LD for key personnel on your About page and then using those entities as:
      • The author properties on BlogPostings
      • The performer properties on Events
    • (If you’re a local business) Hosting Place JSON-LD about your city on a dedicated landing page and using it as:
      • The areaServed property on LocalBusiness
      • The eligibleRegion property on Offer
      • The foundingLocation property on Organization
      • The jobLocation on property JobPosting

    With all of these scenarios, you can use @id to reference entities on other pages to create a literal web of linked data on your website!

    How to use @id in JSON-LD

    Here’s how to use @id in your JSON-LD.

    Step 1: Edit your JSON-LD and give the entity a fragment identifier (e.g., #eru). This uses essentially the same format as the @type property, so you pretty much just copy that. Repeat this process for every JSON-LD script that defines an entity that you want to be able to reference.

    The modification to your JSON-LD should look something like this.

    <script type="application/ld+json">
    {
        "@context": "http://schema.org",
        "@type": "Organization",
        "@id": "#mozOrg",
        "name": "Moz",
      …
    }
    </script>
    

    Step 2: In order to reference one of those entities from JSON-LD on another page, provide an @id in the place of a value for the property in question. For example, instead of just providing a text string of “Moz” for the “publisher” on this BlogPosting, we’d refer to the uniquely identified entity by using its @id.

    The modification to your JSON-LD would look a bit like this:

    <script type="application/ld+json">
    {
        "@context": "http://schema.org",
        "@type": "BlogPosting",
        "publisher": {
        "@id": "#mozOrg"
        }
        …
    }
    </script>
    

    Now, if the entity you’re pointing to lives on a different page, just use the absolute path rather than the relative one. “#mozOrg” becomes “https://moz.com/#mozOrg”

    But wait. There’s more!

    This is the part that really blew my mind. Remember that you can reference entities not just on your own website, but on OTHER websites as well. Doing so is really simple, though you do need to have the ability to slightly modify the JSON-LD on both sites.

    The possibilities here are insane! Just picture the semantic associations we’re forming on this post alone!

    Screen Shot 2016-06-30 at 4.23.31 PM.png

    The good news

    The process is exactly the same as what’s described above (using @id on your own website), but you definitely need to use the absolute path.

    The bad news

    This is super hard to validate without building your own web crawler. By their nature, the structured data validation tools that are available to us (like Google’s Structured Data Testing Tool, the Structured Data Linter, or Yandex’s Structured Data Validator) only fetch the one URL that they’re fed. They’re not going to go out and crawl the URLs where the other linked data lives and show you the full picture that their crawlers may be able to get.

    In the future, I’m hoping to share concrete proof that Google recognizes linked structured data across domains. Until then, the more cross-site structured data we create, the better our chances are of showing that this works!

    Itemref & itemid in action

    This wouldn’t be a very good tutorial if it didn’t leave you with something to fiddle with. The code example below will show you how to use itemref in microdata, itemid in microdata, @id to reference entities on the same page, @id to reference entities on other pages (hint: there may be a really cool entity over at https://moz.com/rand/about/#rand if you want to check it out), and @id to reference entities on other websites.

    See the Pen The Search Marketer’s Guide to Itemref & Itemid by UpBuild (@upbuild) on CodePen.

    You can even run this example’s URL through the Structured Data Testing Tool to see how Google interprets all the associations. Click here to see!

    Screen Shot 2016-06-30 at 5.14.21 PM.png

    Until we meet again

    I hope that this post has either given you some new tools that will help solve your structured data problems or has stoked your curiosity to see what’s possible with advanced JSON-LD. Good luck out there and happy optimizing!




    Sign up for The Moz Top 10, a semimonthly mailer updating you on the top ten hottest pieces of SEO news, tips, and rad links uncovered by the Moz team. Think of it as your exclusive digest of stuff you don’t have time to hunt down but want to read!

    Continue reading →