Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am just learning GA as part of a new program our company is rolling out. I'm sending the following custom event whenever a user clicks on a button on our test site:

<button onclick="_gaq.push(['_trackEvent', 'button1', 'clicked'])">Button 1</button>

I need to output data like this to a table, so how do I report this event programatically (preferably with PHP)? I can see the event on our GA page under 'Real-Time Events', but I only seem to be able to report things like getPageViews() and getVisits().


migration rejected from stackoverflow.com Jan 24 '14 at 11:55

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as unclear what you're asking by Stephen Ostermiller Jan 24 '14 at 11:55

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

Output what data to a table? The only data you have there is number of times clicked. – Collin Grady Dec 28 '13 at 8:03
That's exactly what I need. I'm just learning the basics, and I can't seem to report the number of times that button is clicked. – user34871 Dec 31 '13 at 17:57
Please add more information about what kind of reporting you desire, what format it would be in, and how you would access it. A "table" created with "PHP" is leaving me scratching my head. – Stephen Ostermiller Jan 24 '14 at 11:56