Category: Miscellaneous Postings

The miscellaneous postings section is where I put stuff that doesn’t categorise well anywhere else.

Promo Codes, Discount Vouchers, Etc.

This post has promo codes and discount voucher codes that I come across that I find useful and may need in the near future.

Name.com

Use the promo code MACANDCHEESE at checkout for $10.25 .COM and .NET registrations at name.com – the normal price is $10.99. No, it’s not much of a saving and is not as nice at last month’s one which was for $8.99!

The promo code does not apply to renewals or premium registrations.
Valid in November, 2015.

Read More »

Web server setup, DNS and Email Hosting, Domain Registrars

I have two VPS servers, one in the USA and one in New Zealand. This post explains a little bit about my current VPS providers, web server setup, DNS and email hosting, and the domain registrars I use.

Current VPS providers

My New Zealand VPS provider is Sitehost, and my US based VPS provider is Linode. I moved to the Sitehost VPS from a dedicated server with the same company and to Linode from VPS.net.

The move at Sitehost from dedicated to VPS was to save money and move off physical hardware, and to Linode from VPS.net due to disatisfaction with service levels after being a customer for 15 months (towards the end, there was far too much downtime for my liking and I was fairly unimpressed with their support).

I’ve only been with Linode for a short time as at the writing of this post so we’ll see how that goes…

Roughly half my sites are on the USA based server and half in New Zealand; which goes where depends mostly on the target market.

Server setup

Both servers run Debian 5 and have the exact same packages set up, including PHP, MySQL, Apache, Exim and so on.

I have MySQL set up in a master-master replication relationship so no matter which server the records are modified on, they will be replicated across to the other. I’ll be covering how to set up MySQL with a master-master relationship next week.

The website files are synchronized between the two servers on a six hourly basis using rsync, initiated at the Sitehost end. It pushes its files across to the Linode machine and then pulls the Linode files back to itself.

Should anything go wrong with e.g. the Linode server, I can simply change the DNS records for all domains on that server to point to the Sitehost server and within about half an hour all those sites should then be served from the Sitehost machine.

DNS setup

I moved my DNS hosting to DNS Made Easy in 2004; prior to that I had been running DNS from my own servers but really didn’t want to have to deal with it myself anymore and wanted complete separation from the location of web hosting and DNS. I’ve always found their service to be excellent.

Email setup

I think it was in 2008 that I moved my email hosting to Google Apps. Prior to that I had been hosting email on my own server but it was a pain to manage and Google just deals with spam so much better. Again I also wanted separation between my hosting and email, and it means when I go to move hosting providers it’s one less thing to have to worry about.

Domain registrars

I use 1st Domains for .nz domains, GoDaddy for .com domains and Cheaper Domains for my single .au domain. I prefer to keep DNS hosting and domain registrars separate because it makes it easier to move domains between registrars should I ever need to.

Read More »

iTunes could not connect to the device error

When attempting to connect to an iPhone 4s running iOS 7, we kept getting the error message "Could not connect to the device" or "iTunes could not connect to this iPhone. The device does not recognize this host." This post has a solution which worked for us.

Read More »

Getting back onto Facebook emails

Occasionally I get "Getting back onto Facebook" emails, which I thought was some weird attempt by FB to get me to engage more, but it appears that these emails are sent when login attempts using your email address fail.

Read More »

Facebook screws over pages, yet again

Facebook has for some time now been attempting to monetize posts from "Pages" and generally prevents too much Page content appearing in users’ feeds, unless the Page is prepared to pay to boost their posts. In yet another news feed algorithm change, they’ve made it even harder for Pages to reach their users.

Read More »

Google Analytics API dimensions vs metrics

The Google Analytics API has dimension and metric fields for getting data. If just a metric is specified then the data returned is for the time period as a whole. If dimensions are also supplied then the data is segmented by the metric. This post looks at the XML returned when a dimension is supplied and when it is not.

What is a dimension?

Dimensions are segments like browser and browser version, country, landing and exit pages, the URL or title of a page, and the source website a visitor has come from.

What is a metric?

Metrics are the counts of a dimension for specific data types, such as counts of new visitors, page views, unique pageviews and so on.

Retrieving data for a metric

If you were going to get the count of pageviews and unique pageviews for an account profile as a whole without specifying a dimension, you would specify “ga:pageviews,ga:uniquePageviews” as the metric when making the API call. Example XML output for this for my blog would be something like this:

<entry>
 <id>http://www.google.com/analytics/feeds/data?ids=ga:7426158&&start-date=2009-04-04&end-date=2009-05-03</id>
 <updated>2009-05-02T17:00:00.001-07:00</updated>
 <title type="text"/>
 <link rel="alternate" type="text/html" href="http://www.google.com/analytics"/>
 <dxp:metric confidenceInterval="0.0" name="ga:pageviews" type="integer" value="111634"/>
 <dxp:metric confidenceInterval="0.0" name="ga:uniquePageviews" type="integer" value="101403"/>
 </entry>
 

Note that there are two separate dxp:metric nodes which store the metric name in a name element and the value element of the node is the count for that metric. Because no dimension was specified there will only be one <entery> node.

Retrieving data for the dimension vs metric

If the “ga:pagePath” was used the the dimension value then there will be a number of <entry> nodes equal to or less than the max-results value of the API call. Some example output for one of the <entry> nodes from my blog is as follows:

<entry>
 <id>http://www.google.com/analytics/feeds/data?ids=ga:7426158&ga:pagePath=/jquery-get-set-form-values/&start-date=2009-04-04&end-date=2009-05-03</id>
 <updated>2009-05-02T17:00:00.001-07:00</updated>
 <title type="text">ga:pagePath=/jquery-get-set-form-values/</title>
 <link rel="alternate" type="text/html" href="http://www.google.com/analytics"/>
 <dxp:dimension name="ga:pagePath" value="/jquery-get-set-form-values/"/>
 <dxp:metric confidenceInterval="0.0" name="ga:pageviews" type="integer" value="2903"/>
 <dxp:metric confidenceInterval="0.0" name="ga:uniquePageviews" type="integer" value="2684"/>
 </entry>
 

Note that there is now an additional <dxp:dimension> node which specifies the dimension name and value as elements of the node. A script parsing data from this XML would need to loop through the <entry> nodes and extract the dimension names and values, and metric names and values into some sort of array or other data format to be able to use it.

PHP Analytics API Class

I have written and am continuing to develop and PHP Class for accessing the Google Analytics API which converts the above XML into easy to use arrays. Please refer to my Google Analytics API and PHP Series for more details and to download the class.

Read More »

Get the ID for the Google Analytics API IDS parameter

Google announced an API for the Google Analytics product last week and I posted the start of a PHP class for using the API on Thursday and will post extensions to the class for getting data from the XML this week. In order to get data you need to know the ID for the Google Analytics Account Profile and this post looks at one way to get it without needing any programming code.

Using the Analytics Web Interface

Log into Google Analytics. The table in the main section of the welcome area has a list of your accounts as shown in the example screenshot below. (I have a number of accounts under my login but have Photoshopped them out). Click the account name you want to get the ID for. Where to click is highlighted with the red arrow in the screenshot below.

select the google analytics account

Next you’ll see a list of profiles for the account. Click “View Report” next to the profile you want the ID for. Note that the ID is not the same as the UA-XXXX-XX style code which is shown on this page and what is in the Javascript code that it added to your web pages. Again, the red arrow shows what to click (and I’ve again Photoshopped out the other profiles under this account).

select the analytics profile

Now that you’re on the account profile page look in the browser address bar and you can see the ID there. I’ve highlighted the ID with a red box in the screenshot below. The ID is 7426158 in this example.

get the id from the browser address bar

API Call

The API call to https://www.google.com/analytics/feeds/accounts/default will return a list of all account IDs you have access to with your login and password and is another way to get the IDs. I will show how to do this tomorrow.

Read More »

Disable auto renew at GoDaddy

I use GoDaddy to register my domain names and secure certificates. When a new product is bought from GoDaddy it will be default set to auto-renew. I prefer to manually renew everything and this post shows how to disable auto renewal at GoDaddy. Following these instructions you can also change a product from not auto-renewing to auto-renew.

Read More »