Software design with cats

(Reblogged from idiotter)

User-Authenticated Event Tracking with jQuery + Google Analytics

You probably already know about Google Analytics, and if you use it enough you may even know about Event Tracking with Google Analytics , but haven’t quite figured out an easy and useful way to put it to use, so here’s an idea.

I typically use an MVC framework like Ruby on Rails or Asp.Net MVC to build web apps. However, any framework that allows you to authenticate a user (maybe PHP, Node.js, or Python) and return the username to your html view\page will work for this solution.

Once you have Google Analytics & jQuery working on your page, all you have to do is put this little jQuery nugget on your page:

*example uses ASP.Net Razor syntax to include the authenticated user’s username*

Now, you can easily create a custom report in GA, that looks like this:

image

Obviously, this can be pretty useful, since you’re now able to track the users that are logged onto your site and even try to understand user’s behavior flow.

Btw, I should disclose that storing “personally identifiable information” is against the GA terms of use, so storing a username could result in getting your GA account banned

WePay API now has a C# SDK and MVC examples

  As you may or may not know, I like to move money. I’ve been dealing with the likes of PayPal for almost a decade and more recently Amazon “flexible” payments and have been conditioned to just live with their “kind” of customer service. I’ve also tried some smaller payment processors and most didn’t have a flexible approach to payments that I needed.

  A little while ago I was forced to find an alternative. A colleague suggested WEPAY, which I glanced over about a year ago, and I’m not sure why. Long story, short. It is a pretty awesome API\service for building payment platforms\marketplaces.

  Unfortunately, WePay did not have a SDK for asp.net, so I whipped one up last week. You can see source for SDK and examples in ASP.Net MVC on GitHub here: http://github.com/bradoyler/WePayASPNet

Here’s a small snippet for creating a checkout.

There’s obviously more to it, so read the API docs here: https://www.wepay.com/developer/reference

Also, I have the examples hosted at http://wepay.apphb.com (for the time-being)

The list of supported WePay SDKa are available here: https://www.wepay.com/developer/plugins

Cheers.

User Account Management For Mobile Apps

cloudminellc:

We’re pleased to announce a dedicated set of tools for managing user accounts on all apps developed using our platform.  All examples in this tutorial use the CloudMine iOS SDK, however, all of the operations are also available through our REST API.

Creating Accounts

The CMUser class contains all the methods you need to manage user accounts. To create a new account, initialize a new CMUser object and call the createAccountWithCallback method.

(see also: https://cloudmine.me/developer_zone#ref/account_create)

Login

Once the account is created, the user can be authenticated by calling the loginWithCallback method.

(see also: https://cloudmine.me/developer_zone#ref/account_login)

There is a shortcut for creating an account and logging in with one operation called  createAccountAndLoginWithCallback:

Once the user is logged in, you will need to configure the CMStore for making authenticated requests.

From now on, all requests for user-level data will be authenticated with the user’s credentials.

Logout

When you want to terminate a user’s session, call the logoutWithCallback method.

(see also: https://cloudmine.me/developer_zone#ref/account_logout)

Password Change

Users now have the ability to change their password. For security purposes, the user must provide their old password along with their new password.

(see also: https://cloudmine.me/developer_zone#ref/password_change)

Forgotten Password Reset

If a user forgets their password, they can request that an email be sent with instructions on how to reset it.

(see also: https://cloudmine.me/developer_zone#ref/password_reset)

How to Store and Retrieve User Data

There are many different methods for retrieving data from the CMStore. Each method has two versions: one to fetch app-level data, and one for user-level data. To store or retrieve user objects, call the “user” version of any method in CMStore: as long as the CMStore has been initialized with a logged-in user, requests will transparently be authenticated with that user.

For example, to retrieve all user objects, call the allUsersObjectsWithOptions method.

For more information, visit our iOS Library Documentation.

(Reblogged from cloudminellc)

PitchSwap: Getting Entrepreneurs to listen to themselves.

After some thinking (over shots of tequila) on how to create a simple, fun, worthwhile event for entrepreneurs, I stumbled upon the idea of getting people together that have something they’d like to pitch, but then forcing them to pitch someone else’s idea, in hopes the favor would be reciprocated.

I initially thought this would be cool, because this concept could have a few benefits. (1) It could force people to talk to strangers about their idea for the first time, this is a big step to many aspiring entrepreneurs. (2) To the audience, it could seem a lot less like a commercial since your not hearing it from the founder. (3) As the founder, it could be great feedback to hear your pitch from another perspective, not to mention hear a bunch of other pitches in lightening talk fashion. (4) As the Pitcher, there’s not a whole lot of pressure or reason to be embarrassed, since it’s not your idea anyway.  (5) With the right setting, it could be a lot of fun.

I say *could* because I have no friggin idea, but there’s only one way to find out. And that’s why PitchSwap.co was born.

So, here’s an attempt to lay out some basic ground rules for the inaugural event on June 14.

  1. Bring an idea for someone else to pitch or be willing to pitch someone else’s idea. You can always think of something on the spot…if not, ideas are dime a dozen with this crowd.
  2. You will have ~1 hour to network and find someone to pitch your idea of vice versa. I’m sure many will do this on the fly, but having note cards could be a great aid to transposing your pitch to someone else. Also, you’re not required to speak, if you’re not up for it, no problem. But remember, you can’t enjoy the glory of victory without getting in the game.
  3. Pitches will be lightening talk fashion: ~2 minutes. Due the the presence of adult beverages, I’m actually hoping a lot of the pitches will attempt to be humorous. But trust me, that’s even harder that pitching a serious pitch. However, I completely encourage the silly pitch.
  4. After the pitches commence, judges will deliberate and give awards for various categories, decided on the fly. (ie. Best Delivery, Best Idea, Best Comic, etc.)

I hope that covers most of it. But expect to be surprised. I also plan to take a lot of pictures to document the event. So put on your Sunday best (or not) and get your Tickets here.

Cheers!
- Brad

LINQ to SQL DataContext Wrapper (Adapter)

If plan to Mock LINQ to SQL for Unit testing (using a repository pattern). You’ll most likely need one of these: 

Using CloudMine to log PageViews with ASP.Net MVC

I’ve used a few services in the past to do site “event tracking” (ie Google Analytics)  but most didn’t give me all the data and control I need to easily track what was needed… (mostly user identity stuff). Another big difference is that this is all done server-side, which has it’s pros\cons as well. 

Anyway, here’s how I did it using CloudMine’s backend service in ~20 lines of code.

Step1. Add this Action Filter to your MVC application (ie Global.asax.cs)



[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)]
    public class UserTrackingAttribute : ActionFilterAttribute
    {
        public static readonly string appId = "your CloudMine app Id";
        public static readonly string appSecret = "your CloudMine app Secret";

        class PageRequest
        {
            public int PageId { get; set; }
            public Double Created { get; set; }
            public string Url { get; set; }
            public string UserName { get; set; }
            public string UserIP { get; set; }
            public string Controller { get; set; }
            public string Action { get; set; }
        }

        public override void OnResultExecuting(ResultExecutingContext context)
        {
            PageRequest preq = new PageRequest
            {
              Url = request.RawUrl, 
              UserIP = request.UserHostAddress, 
              UserName = context.HttpContext.User.Identity.Name, 
              Created = ExtensionMethods.JsonDate(DateTime.Now),
              Action = (string)context.RequestContext.RouteData.Values["action"], 
              Controller = (string)context.RouteData.Values["controller"],
              PageId = Convert.ToInt32(context.RouteData.Values["Id"]),
            };
          
          using (var client = new WebClient())
          {
           client.Headers.Add("X-CloudMine-ApiKey", appSecret);
           client.Headers.Add("Content-Type", "application/json");
           var serializer = new JavaScriptSerializer();
           var data = serializer.Serialize(preq);
           var payload = "{\"PV_" + DateTime.Now.Ticks + "\":" + data + "}";
           var bytes = Encoding.Default.GetBytes(payload);
           client.UploadDataAsync(new Uri("https://api.cloudmine.me/v1/app/" + appId + "/text"), "PUT", bytes);
          }
        }
         

Then… just add the filter attribute [UserTracking] to any controller action and you’re ready to start logging…in real-time. 

The full example project is on my GitHub…so go fork it.

Creating a Logo in 10 seconds with LogoType

I wanted to play around with the Google WebFonts API for some reason and came up with a somewhat cool little web-based utility called:

logotype

Demo here: http://www.w3portals.com/logotype

Source: https://github.com/bradoyler/LogoType 

It’s a really quick way to create a “draft” logo. 

So after you select your colors and Font, you can simply take a screenshot of the page and copy into your favorite image editor. If I guess enough requests, I may even add some other features and additional fonts.

P.S. I seem to get the best resolution in Firefox.
Happy branding!

 AddThis just published their 2011 stats on “sharing” across the web.

 AddThis just published their 2011 stats on “sharing” across the web.

(Reblogged from staff)
Fork me on GitHub