Pages

Wednesday, July 2, 2014

How to Track Outbound Links in Google Analytics

How to Track Outbound Links in Google Analytics


How to Track Outbound Links in Google Analytics

Posted: 02 Jul 2014 12:00 PM PDT

Google Analytics provides an overwhelming quantity of information. If you do nothing but add the tracking script to your pages, you'll be faced with an endless stream of data and reports about user activity on your site. However, while Analytics shows exit pages it won't tell you which links users clicked to leave your site. In this article we'll discover how to add outbound link tracking.

Does Google Record Outbound Links?

Probably. If you're linking from one site using Analytics to another using Analytics Google could record that relationship. Unfortunately, reports would be misleading if one or more outbound sites didn't use Analytics. Google has additional means of collecting data: you can gather a lot of statistics when you own the top browser and search engine! But we're then moving away from on-site Analytics into more dubious territory; Google wouldn't necessarily want to share that data.

Continue reading %How to Track Outbound Links in Google Analytics%

Responsive Design vs ‘m.’ Sites

Posted: 02 Jul 2014 11:30 AM PDT

The segregation of the mobile experience to a subdomain, the notorious 'm' domain, seems a little old school in 2014. It's a legitimate question, in the fast-moving realm of mobile-web development, whether you should even consider having such a segregation.

In this article, I start from the premise that few entities use an 'm' domain any more, and present a few reasons why not. Then, playing devil's advocate, I'll offer a few reasons why you might want a separate subdomain to which to redirect your mobile user base.

Why nobody does it any more

RWD All The Things

The advent of responsive web design, mobile-first design, and progressive enhancement as design patterns have been enthusiastically embraced by many designers and developers. They have changed the way the business of design and development is done. Site designs, especially those built from scratch, are increasingly built from the 'bottom up' rather than the 'top down'. Rather than creating a beautiful, feature-full site that will display well on large desktops and taking away or hiding functionality as the user's screen shrinks to mobile.

A mobile-first design would start with a design that is attractive and functional on the smallest, and even potentially slowest or off-line mobile screen and progressively enhance the experience towards the high-definition desktop experience.

Going further, Scott Jehl recently suggested not so much a “mobile-first” strategy but rather a “global-first” strategy. Design a set of styles that are must haves across all screens and then enhance depending on a browser's capability, dependent on what Scott terms a “cut the mustard” set of tests.

Continue reading %Responsive Design vs ‘m.’ Sites%

SassDoc: A Documentation Tool for Sass

Posted: 02 Jul 2014 11:00 AM PDT

For a while now I have been using my own comment system to document my Sass functions and mixins. As of today, looks something like this:

[code language="scss"] // Clamp `$value` between `$min` and `$max`. // // @author Stan Angeloff // // @param {Number} $value - value to clamp // @param {Number} $min (0) - minimal value // @param {Number} $max (1) - maximum value // // @throws All arguments must be numbers for `clamp`. // // @return {Number} - clamped number @function clamp($value, $min: 0, $max: 1) { @if type-of($value) != "number" or type-of($min) != "number" or type-of($max) != "number" { @warn "All arguments must be numbers for `clamp`."; @return null; } @return if($value > $max, $max, if($value < $min, $min, $value)); } // @var {Bool} - Defines whether the library should support legacy browsers (e.g. IE8). $legacy-support: true !global; [/code]

This syntax, while close to that of JSDoc, is quite personal. It not only helps me document my functions and mixins but also provides enough information to other developers using the code so they can understand what's going on.

When other developers saw these comments in my code, they thought I was using this syntax to generate documentation. So I thought: What a brilliant idea! Why not using these comments to build a whole documentation system? It sounds like a great project!

Introducing SassDoc

So I built SassDoc, distributed as an npm package.

There are 2 ways to use SassDoc:

  1. Run it from your terminal on your Sass folder; or
  2. Use it in your JavaScript applications.

In either case, you need to install it first:

Continue reading %SassDoc: A Documentation Tool for Sass%

Managed WordPress Hosting: The Pros and Cons

Posted: 02 Jul 2014 10:00 AM PDT

Choosing a web host can be one of the toughest decisions you make as a web development professional, because your decision plays a significant role in whether your client's business will succeed or fail. Unfortunately web hosts are now a dime a dozen. Plus the fact that many hosts white-label their services to third parties means that the company you recommend to a client might not even have direct control over the servers they claim to provide. In the past, web hosting was simply a service where the host provided the hardware, and the client provided the code. Today however, managed WordPress hosting has emerged as one of the hottest offerings in the web hosting space. Some of the biggest players in this sector are WP Engine, and Pagely, as well as traditional hosting companies such as Media Temple and GoDaddy who now also offer specialized WordPress hosting. Of course, we can't forget WordPress.com and WordPress VIP (who offer high end hosting).

Continue reading %Managed WordPress Hosting: The Pros and Cons%

Debugging Varnish

Posted: 02 Jul 2014 09:00 AM PDT

At 99designs we heavily (ab)use Varnish to make our app super fast, but also to do common, simple tasks without having to invoke our heavy-by-contrast PHP stack. As a result, our Varnish config is pretty involved, containing more than 1000 lines of VCL, and a non-trivial amount of embedded C. When we started seeing regular segfaults, it was a pretty safe assumption that one of us had goofed writing C code. So how do you track down a transient segfault in a system like Varnish? Join us down the rabbit hole… Get a core dump The first step is to modify your production environment to provide you with useful core dumps. There are a few steps in this: First of all, configure the kernel to provide core dumps by setting a few sysctls:

Continue reading %Debugging Varnish%

Continuous Integration with PHP-CI

Posted: 02 Jul 2014 09:00 AM PDT

Creating an application is one thing. Keeping it to a certain quality level is another thing entirely. These days, you can find many tools which can help you to keep the quality of your application in shape. Running these tools one by one can be very time consuming. For that, you can install so called continuous integration (CI) services. PHPCI is one of those and in this article, we will dive into it.

Continuous integration service

A continuous integration service is an application which runs certain quality check tools against your code. For example, a CI could pull in your git repository. When done, it runs unit tests, checks your code for validations and generates reports based on it. In general, a CI runs on certain time intervals or on every push. The most seen situation is right after creating a merge request. By checking the merge request, the code is checked before being merged, making sure you are not accepting code which could break functionality. So integrating CI within your development procedure can make sure bad code is kept out of your main repository and you can validate automatically if everything meets your requirements before accepting changes.

Installation

Installation can be done in two different ways. Either you download the latest release or you follow the installation guide. I decided to go with the installation guide and install it through Composer. After running composer update you can run the install script. You will be questioned for database credentials and your email address. When done, a user is created with the given email address.

You also need to set a cronjob so builds are run automatically.

Setup

Depending on what you want to do, you have to install some tools. After logging in, you can go to admin manage plugins and install any necessary plugins. By installing a plugin, you are updating the composer.json file with new requirements. So right after you installed the plugins you need to run composer update to actually install these plugins.

Plugins

Add a project

By clicking the add project button in the header, you can create a new project. You have to fill in a simple form, which indicates were the code is located. You can choose between different kinds of services like Github and Bitbucket, but also for your own remote or local URLs. If you don't have a phpci.yml configuration file within your repository, you need to provide the build configuration. Within his configuration, you define how the project needs to be set up, which tools you want to run and how to finalize the build.

Each build process consists of 5 phases.

  1. Setup. The phase were everything is initialized
  2. Test. The phase were all tests are executed
  3. Complete. Success or failure, this part will always run
  4. Success. Will only be run in case of success
  5. Failure. Will only be run in case of failure

I will be using this project as our project. We want to ignore default directories like app and vendor. Installation will be done through Composer. The project should be PSR2 compliant, has unit tests and contains decent docblocks. We also want to check if the overall quality is fine by running PHPMD, PHPCPD and PHPLoc.

PHPCI is capable of handling a test database. However, the project we are using in our example does not have any functional tests, so we will leave out the MySQL connection.

Let's take a look at what the configuration would look like.

Continue reading %Continuous Integration with PHP-CI%

Asynchronous File Uploads in Rails

Posted: 02 Jul 2014 07:00 AM PDT

Today, we'll explore a bit more about file uploading, such as how to implement asynchronous file uploading with Rails as well as uploading multiple files using AJAX.

We are going to take a look at two solutions: Remotipart and File Upload.

Some other things to be covered in this article:

  • Creating a progress bar to track the file uploading progress and display bitrate.
  • Implementing client-side validation.
  • Adding a "dropzone" with some nice CSS3 effects, allowing users to drag & drop files to be uploaded.

Continue reading %Asynchronous File Uploads in Rails%

0 comments:

Post a Comment