2

I'm trying to submit a virtual pageview to track events within application, that may not be associated with user visiting a page, and therefore will not allow for execution of javascript. The project is in python on GAE.

So far, I've tried to submit a pageview via an image API via a GET request, but that does't seem to work. Here's a sample URL:

http://www.google-analytics.com/__utm.gif?utmac=UA-<account_ID>-1&utmp=/<event>/<date>

Given a Google Analytics account ID and domain as the only information, how do I submit a pageview to Google Analytics from server side?

Sologoub
  • 5,312
  • 6
  • 37
  • 65

1 Answers1

4

You can use this lib that sends the required request to Google Analytics to mimic a page view event.

Shay Erlichmen
  • 31,691
  • 7
  • 68
  • 87
  • There's a fork that caters specifically to GAE APIs https://github.com/singhj/Google-Analytics-for-Mobile--Google-App-Engine – Yahel Jan 02 '12 at 22:20
  • Haven't tried this yet, but went through the code and it seems like what I need. Thanks again! – Sologoub Jan 04 '12 at 00:21
  • That code, particularly the fork, is a disaster. I'd recommend going back to the original PHP samples google gives out, and porting it yourself. It's only a few lines. – Joshua Smith Feb 24 '12 at 15:18