If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

You probably know that your keyword list and testing results are the most valuable assets in your PPC marketing campaign. Without the right keywords and the best converting landing pages for each of them, you are the same as anyone else in your niche. But did you know that your merchants are probably looking at your tracking data and may be using it for their own in-house PPC marketing? Here is an *easy* (or maybe not) way to make sure all of your data is protected.

How It Works

All you need to do is come up with a simple encryption system for your campaign, ad group, keyword, and testing data. This must, however, be done with database programming (such as PHP/MySQL) because trying to keep track of this stuff manually would be impossible.

Basically, we are just taking each tracking value, giving it a numerical ID, and converting that ID into a compressed alphanumeric string. This is similar to using numbers, but greatly expands the amount of possibilities. If we have a tracking ID that is three digits long and uses “0-9″ we would be able to store “999″ different values. Conversely, if we use “0-9″, “a-z”, and “A-Z” we would be able to store 238,327 unique values (62*62*62-1). Think you might need more than that many values? Adding a fourth character would increase the total to almost 15 million!

So what you can do here is create a string of all these unique IDs. An example data string could be “bo-29Di-w9j-w2BI”. This would give you 4 different variables with plenty of unique possibilities for each of them. And no one would ever know what that information means.

Now, to implement a system like this, you will need some programming that encrypts and decrypts your values on the fly. You would ideally want it to take an entire CSV report and organize all of the data for you. Depending on the level of protection you want, you could encrypt your variables in your PPC campaigns (hiding your data from everyone) or you can encrypt them on your landing page (hiding your data from the merchants/networks only).

Assigning Numerical IDs

The first step is to assign each of your variables a numerical ID that will be stored in your database. The easiest way to do this is to just store the variable and let the database software automatically assign an incremental ID. There are many ways you could do this. You could have one table that holds “records” (campaign, ad group, keyword, and id), you could have multiple tables that hold variable, or you could have one table that holds keywords.

I think the second approach is the best and most flexible. So, I will create one table for each type of data that I want to track. There will be a table of campaigns, a table of ad groups, a table of keywords, and tables for any miscellaneous data. These tables will only include two fields each, a data field and an ID field. Here is an example of what a “keyword” table might look like:

keyword-encryption.gif

How you get those values into your database is up to you. You could create the entries “on-the-fly” or you could pre-populate them.

Converting Numeric IDs to Alphanumeric IDs

Now that we have all of our tracking information stored in a database, we can reference their IDs and no one will know what they mean. However, instead of including extremely long numerical information, we will convert them to an alphanumeric system to shorted everything up. Here is the part of my script that turns any number into a base-62 string:

This code isn’t really a matter of programming, it is more of a math problem. What it does is build the number from right to left by continually getting the remainder and converting that to one of the 62 available characters until there are no more remainders left.

Converting Alphanumeric IDs Back to Numeric IDs

After you have passed your encrypted tracking variables to the merchant, and they have been tracked in your affiliate account, you need a way to translate them back into readable information. Here is the part of my script that turns your base-62 string back into a number:

This code works in reverse of the previous code. It takes each “character” and converts it to is respective value by multiplying it by it placement and then adds them all together. In standard numbers this is equal to getting 672 out of 600+70+2… it just looks more complex because it is base-62 instead of base-10.

Why Go Through All This Trouble?

There are a couple reasons why would you want to implement an encryption system like this into your tracking efforts. The most obvious benefit, which was already mentioned, is that it protects your valuable data from prying eyes. No one, unless they have access to your database and translation scripts, will know what the information means.

Another benefit is the ability to easily track tons of variables. It might be easier to use explicit variable names in your URLs when you are only tracking a couple variables, but what if you wanted to track 10-15 different things such as keywords, colors, headlines, graphics, layouts, and more?

Here are some more articles that I wrote on testing and tracking. Have a look at them to further understand the implementation and importance.