A site I maintain tweets every time a blog post is published.

Since the editors of the site have gone a bit mad with the ability to change the apparent date a blog post was published (back-dating as a layout tool), the twitter stream is the easiest way I have of knowing the actual date of publication.

I now need to make a case for the efficacy of blogging (in conversion terms) and have turned to Google Analytics, who have been hoovering up our visitor data for over a year. My first thoughts were therefore to add annotations for each blog publish event, so that the ramps and spikes are more easily interpreted.

Is there any way of importing data to be used as annotations? How hard would it be to massage the twitter stream data into a format that Google might play nicely with? Would it just be easier to manually add an annotation for each tweet?

1 Answer 1


Google Analytics doesn't support automated annotations via their API (although there's an open feature request for it).

Likewise, they don't appear to support bulk import of annotations. As such, even if you could extract original publish dates from your blogging software (or lift them from twitter), you're stuck adding each annotation manually, one at a time.

For that reason, if you're trying to prove that posting regularly has a positive effect on traffic, I would suggest sampling a short period—say, a month—in which many posts were published, annotate those publish dates in Google Analytics, and compare that with a period in which few posts were created.

In future, Google may offer up the annotation feature via its API. When that happens, you could add annotations when each post is first published rather than attempting to hack something together that crawls twitter and submits data to Google Analytics en masse. With WordPress, for example, you might use the publish_post hook to ping the Google API to add an annotation each time a post with a unique ID is published. (You'd check it has a unique ID to make sure it's being published for the first time; you don't want to send data to Analytics if it's just being edited later on.)

  • Using the publish_post hook sounds like a great way to do this. Just got to hope Google gets around to adding the functionality... Oh well.
    – Tom Wright
    Jul 12, 2011 at 14:33
  • @Tom I agree. Annotations would be even more useful if you could add them via the data API. (Don't forget to star the feature request; Google prioritises new features based partly on popularity.)
    – Nick
    Jul 12, 2011 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.