Use deprecated course_key when calling the analytics API.

Previously it was serializing the course_key directly, which is not
interpreted correctly by the API.