Monday, October 23, 2017

Your Guide to Understanding Key Analytics Terms

The following is a short extract from our book, Researching UX: Analytics, written by Luke Hay. It's the ultimate guide to using analytics for improved user experience. SitePoint Premium members get access with their membership, or you can buy a copy in stores worldwide.

For those not used to looking at website analytics, some of the terminology can seem like a foreign language. This can get even more confusing when terms change, or when different tools use different terms to describe the same thing.

Some analytics terms that are used regularly are often misunderstood. In some cases, a partial understanding of a term may be more dangerous than having no understanding at all. One commonly misunderstood example is the word “hit”.

A hit is often thought of as being a synonym for a page view or a visit. This is not the case, as each file request to a web server is an individual hit.

This means that, if a web page contains five images, a user viewing this page will count as one page view but six hits (the five images plus the HTML page itself). You can see how this misunderstanding can lead to a wildly inaccurate understanding of the data! This section covers the most important analytics terms. (There are also short definitions of the main terms in the glossary at the end of this book.)

Dimensions and Metrics

All the data in your analytics reports can be divided into dimensions and metrics. It’s important to know what each term means so that you can better analyze your data. A good understanding of dimensions and metrics is also important for setting up custom reports and dashboards.

Dimensions are a way to group data—a form of categorization or identification. A dimension does not refer to the size of something (a common misunderstanding). Dimensions are normally shown in the first column of your reports. Examples of dimensions include Country, Page Title and Device Type.

Metrics, on the other hand, are the numbers associated with those dimensions. They appear in the other columns of your reports, showing the numbers relating to the dimensions in the first column. Examples of metrics include Pageviews, Bounce Rate and Avg. Time on Page. Metrics help you understand the behavior of your users. They count how often things happen—such as the number of visits to your website or app. Metrics can be totals, averages or percentages of a total.

The screenshot below shows dimensions and metrics, as well as the different ways metrics are counted:

An easy way to differentiate the two is to remember that dimensions are often words, while metrics are more likely to be numbers.

Sessions, Visits, Page Views and Unique Page Views

As touched on in the previous chapter, there is often confusion between sessions, visits and page views. Firstly, it’s worth pointing out that sessions and visits are essentially the same thing. Google Analytics previously used the term “visit”, but changed the terminology to “sessions” in 2014. Other tools, such as Adobe Analytics, still use the term “visits”.

You’ll generally find that the two terms are used interchangeably, but as long as you know these are referring to the same thing, it shouldn’t be a problem.

A session, or visit, is a group of interactions (or a single interaction) that a user takes within a given time frame on your website. Google Analytics sessions time out after 30 minutes of inactivity by default, though you can change this yourself in your analytics settings.

This means that, if your user goes to make themself a coffee, leaving your website open in their browser, and returns within half an hour, this will be counted as the same session. The same can be said for users who hop between multiple tabs. More often than not, though, sessions represent continuous browsing of your website.

Sessions don’t differentiate between unique individuals. They only count the number of sessions, regardless of who’s doing them. If I visit your website in the morning and come back in the evening, that would still count as two sessions. Using other metrics like users or visitors will give you information on about individuals who visit your website. The next section in this chapter covers users and visitors in detail.

Page views are simply views to an HTML page or, less commonly, virtual page views. A virtual page view is a way of telling Google Analytics to register a page view if a new HTML page has not been loaded. Virtual page views require additional tagging in the form of JavaScript code. You can use them everywhere where content is loaded without a reload of the page, or when two or more pieces of content can reside on the same URL—for example, a form submission, or one-page checkouts.

You can have multiple page views during one session if a user is browsing your website. Page views are normally categorized as page views and unique page views. If a user views the same page more than once during a session, this will only count as a single unique page view. This is useful if you want to get an idea of how many sessions included a view to a particular page, but you don’t want that number inflated by users who returned to that page in the same session.

Users and Visitors

As Uxers, we have a good idea of what a “user” is. In our industry, users would generally be defined as individual humans who interact with our product—often a website, app or a piece of software. Analytics packages rarely have a way of accurately identifying individuals, though, so in analytics the term “user” has a slightly different meaning from the normal one.

Most of the major analytics tools will identify users based on cookies. If I visit your website from my laptop, your analytics tool will normally drop a cookie into my browser so that, when I return, it will recognize me as the same individual who visited previously.

This is broadly correct, but it doesn’t take into account that I might share my laptop with someone else. This means that two different individuals can be counted as the same user. Conversely, analytics tools are often unable to identify cross-device (or cross-browser) visits. If I visit your website from my tablet, your analytics tool will be unlikely to identify me as the same user who visited from my laptop.

If you have a website that requires users to log in, or uses some other sort of unique identifier such as an email address or mobile number, then this may enable you to track users across devices. This requires additional setup, though, and relies on users logging in or otherwise identifying themselves on each of their devices.

As with sessions and visits, “users” and “visitors” are generally different terms for the same thing. Different tools will use different terminology, but as long as you remember that visitors and users both normally describe a theoretical individual, based on a cookie, then that’ll be good enough.

Users, or visitors, are often broken down into “new” and “returning”. New visitors are people who have visited your website for the first time during your reporting period, while returning visitors have visited more than once. By breaking this down, your analytics tool enables you to easily compare the behavior of these two user groups.

You need to be careful here, though, as the metrics “new” and “returning” may not be as accurate as you’d expect. As touched on previously, analytics packages rarely track cross-device visits. This means that, if I start something on my phone and finish it on my laptop, it’s likely that I’ll be recorded as a “new” user when I visit via my laptop. Also, users will be recorded as “new” if they clear their cookies, or have a JavaScript or ad blocker installed.

Visit/Session Duration and Time on Page

Time-based metrics are notoriously inaccurate. This is partly due to the way they’re calculated, and partly due to the inability to track a user’s attention.

Google Analytics calculates session duration as the time between the first and last interaction during a visit to your website. It does not, as you might expect, calculate the duration based on when the user arrives on your website and when they leave. Google Analytics has no way of knowing when a user exits your website; it can only track their interactions while they’re on it. This means that, if a user spends five minutes looking at your home page, 20 minutes reading a blog post, and then exits the website, their visit duration was just five minutes. Conversely, if a user has left your website open in another tab for ten minutes while they browse another site, as long as they return to your site and move on to another web page, that ten minutes will count towards their duration on your site!

Time-on-page metrics work in a similar fashion to session duration. The timer starts when a user first loads a particular page and stops when they move on to another page on the website. No time is recorded for that page if a user exits your website from there. This means that a user can read a long blog post on your website, but if they exit from that point before viewing any other pages, their recorded “time on page” will be zero seconds. If a user only visits a single page during their session, both their time on that page and their session duration will be registered as zero seconds.

All of this means that time-based metrics are not very accurate at all.

This underlines the importance of analyzing based on trends over time, rather than looking at exact figures. If your average session duration is five minutes, that may not tell you very much. You’re better off focusing on what the session duration was last month, or last year, and analyzing whether this has gone up or down—and, most importantly, finding out why.

You need to be careful here, though. If, for example, a blog post on your website gets lots of attention on social media one month, and drives lots of users who just read the post, then leave, this alone could massively impact your average session duration. This underlines the need to be aware of what’s happening across all of your website, and to avoid focusing on the headline figures.

Bounce and Exit Rates

Two metrics that often get confused are bounce and exit rates. These are reported in slightly different ways in different analytics tools. The definitions below are based on how they’re reported in Google Analytics.

A bounce describes a single page visit to a website. This means that the user arrives on a page and then leaves without viewing any other pages. The bounce rate is the percentage of visits to a website, or web page, that were bounces. A bounce rate of 10% means that one in ten of your website visitors only visited one page during their session. It’s the same for individual pages. If your “about” page has a bounce rate of 50%, this means 50% of the sessions that included a visit to this page were single page visits.

The exit rate for a page shows the percentage of visits to the page that ended with users exiting the site from there. The diagram below shows how bounces and exits differ.

These two metrics are similar, but it’s important to understand the difference between them. The bounce rate for a page is largely affected by the number of people who enter the website on that page. Often exit rate is a more useful metric to use for this reason.

Continue reading %Your Guide to Understanding Key Analytics Terms%


by Luke Hay via SitePoint

The 2017 Email Marketing Field Guide: The Best Times and Days to Send Your Message and Get It Read - #infographic

From creating copy to the best time to hit send, email marketing is not an easy task, but there are certain things you can do to help make your campaign successful. If you really want to get your email opened and read, one of the most important things is to send it at the best time. Depending on...

[ This is a content summary only. Visit our website http://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Web Desk via Digital Information World

The Ultimate Writer's Guide to Success - #infographic

Whether you’re a beginner or a seasoned writer, chances are you’ve struggled with your work at some point. Maybe you’re a slow writer and have trouble producing enough work or meeting deadlines. Or maybe it seems like all good ideas have already been taken and you can’t come up with anything new to...

[ This is a content summary only. Visit our website http://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Web Desk via Digital Information World

Speeding Up Python With Cython

Cython is a superset of Python that lets you significantly improve the speed of your code. You can add optional type declarations for even greater benefits. Cython translates your code to optimized C/C++ that gets compiled to a Python extension module. 

In this tutorial you'll learn how to install Cython, get an immediate performance boost of your Python code for free, and then how to really take advantage of Cython by adding types and profiling your code. Finally, you'll learn about more advanced topics like integration with C/C++ code and NumPy that you can explore further for even greater gains.

Counting Pythagorean Triples

Pythagoras was a Greek mathematician and philosopher. He is famous for his Pythagorean theorem, which states that in a right-angled triangle, the sum of squares of the legs of the triangles is equal to the square of the hypotenuse. Pythagorean triples are any three positive integers a, b and c that such that a² + b² = c². Here is a program that finds all the Pythagorean triples whose members are not greater than the provided limit.

Apparently there are 881 triples, and it took the program a little less than 14 seconds to find it out. That's not too long, but long enough to be annoying. If we want to find more triples up to a higher limit, we should find a way to make it go quicker. 

It turns out that there are substantially better algorithms, but today we're focusing on making Python faster with Cython, not on the best algorithm for finding Pythagorean triples. 

Easy Boosting With pyximport

The easiest way to use Cython is to use the special pyximport feature. This is a statement that compiles your Cython code on the fly and lets you enjoy the benefits of native optimization without too much trouble. 

You need to put the code to cythonize in its own module, write one line of setup in your main program, and then import it as usual. Let's see what it looks like. I moved the function to its own file called pythagorean_triples.pyx. The extension is important for Cython. The line that activates Cython is import pyximport; pyximport.install(). Then it just imports the module with the count() function and later invokes it in the main function.

The pure Python function ran 50% longer. We got this boost by adding a single line. Not bad at all.

Build Your Own Extension Module

While pyximport is really convenient during development, it works only on pure Python modules. Often when optimizing code you want to reference native C libraries or Python extension modules. 

To support those, and also to avoid dynamically compiling on every run, you can build your own Cython extension module. You need to add a little setup.py file and remember to build it before running your program whenever you modify the Cython code. Here is the setup.py file:

Then you need to build it:

As you can see from the output, Cython generated a C file called pythagorean_triples.c and compiles it a platform-specific .so file, which is the extension module that Python can now import like any other native extension module. 

If you're curious, take a peek at the generated C code. It is very long (2789 lines), obtuse, and contains a lot of extra stuff needed to work with the Python API. Let's drop the pyximport and run our program again:

The result is pretty much the same as with pyximport. However, note that I'm measuring only the runtime of the cythonized code. I'm not measuring how long it takes pyximport to compile the cythonized code on the fly. In big programs, this can be significant.

Adding Types to Your Code

Let's take it to the next level. Cython is more than Python and adds optional typing. Here, I just define all the variables as integers, and the performance skyrockets:

Yes. That's correct. By defining a couple of integers, the program runs in less than 57 milliseconds, compared to more than 13 seconds with pure Python. That's almost a 250X improvement.

Profiling Your Code

I used Python's time module, which measures wall time and is pretty good most of the time. If you want more precise timing of small code fragments, consider using the timeit module. Here is how to measure the performance of the code using timeit:

The timeit() function takes a statement to execute, a setup code that is not measured, and the number of times to execute the measured code.

Advanced Topics

I just scratched the surface here. You can do a lot more with Cython. Here are a few topics that can further improve the performance of your code or allow Cython to integrate with other environments:

  • calling C code
  • interacting with the Python C API and the GIL
  • using C++ in Python
  • porting Cython code to PyPY
  • using parallelism
  • Cython and NumPy
  • sharing declarations between Cython modules

Conclusion

Cython can produce two orders of magnitude of performance improvement for very little effort. If you develop non-trivial software in Python, Cython is a no-brainer. It has very little overhead, and you can introduce it gradually to your codebase.

Additionally, don’t hesitate to see what we have available for sale and for study in the marketplace, and don't hesitate to ask any questions and provide your valuable feedback using the feed below.


by Gigi Sayfan via Envato Tuts+ Code

Want to Be A Millionaire? Then It's Time to Adopt These 6 Habits [Video]

The habits of successful people may extend well beyond the obvious financial moves.

[ This is a content summary only. Visit our website http://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Irfan Ahmad via Digital Information World

How to Create Screencasts With Your Smartphone

Want to produce how-to videos for your social media audience? Wondering how to create screen recordings with your smartphone? In this article, you’ll learn how to record screencasts on your mobile device and then customize them for top social media platforms. Why Use Mobile Screencasts on Social Media Creating mobile screencasts to share tips, apps, [...]

This post How to Create Screencasts With Your Smartphone first appeared on .
- Your Guide to the Social Media Jungle


by Tabitha Carro via

The Rising Power of Visual Content - #infographic

Storytelling and data visualization are the need of the hour. Hence businesses and brands are concentrating on showing, rather than telling. Visual content is the breakout trend of the year and are sure to rise higher and higher.

[ This is a content summary only. Visit our website http://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Web Desk via Digital Information World