40

I send some event to Google Analytics using this function

_gaq.push(['_trackEvent',category,action,label,value]);

but I sent them just for testing my code and now I want to delete them and start real tracking. How can I delete them?should I use any code for this?

PS:I see my testing result in content>EventTracking section

pooya
  • 901
  • 2
  • 15
  • 29
  • I support the concern - How to delete it ? How should it be done is different -- from how should one fix a already polluted stats ? – Yugal Jindle Jan 11 '13 at 05:07

3 Answers3

48

You cannot delete it. That is why it is important to setup a test profile to send data to while you implement/qa.

CrayonViolent
  • 32,111
  • 5
  • 56
  • 79
  • 8
    +1. In lieu of setting up a test profile, I'll sometimes put this line in my debug code, though its critically important to remove it once you're done testing: `_gaq.push = function(){window.console && console.log(arguments);};` – Yahel Dec 07 '11 at 20:26
  • 3
    I would highly recommend sending to a test profile though, so that you can make sure the tracking is going to give you the reports you want. – CrayonViolent Dec 07 '11 at 20:50
  • 3
    Well, we know we should have a test profile. But its not about that - its about lets say we have pushed some garbage - then how do you fix it ? – Yugal Jindle Jan 11 '13 at 05:07
  • 14
    you can't "fix" it. I told you, you can't delete data once it is in GA. If you are a big enough fish, you could try appealing to Google directly to remove it, but I know some pretty big fish, and Google will barely give them the time of day, and certainly won't go manually deleting data from their GA databases for them, so good luck on that. btw, downvoting me won't change this fact. I know it's not the answer you want to hear, but it is nonetheless the correct answer. – CrayonViolent Jan 11 '13 at 22:18
20

You can create a Custom Report. There is a Filters section that will allow you to filter out specific event categories, actions, labels, etc. In the example shown below, I am filtering out categories/actions that contain the word "test":

enter image description here

James Lawruk
  • 30,112
  • 19
  • 130
  • 137
  • 4
    This is a good alternative but note that this does not remove data, it only hides it. Also, you need to be very careful about doing this. there are certain "quirks" about segments and filters that could cause you to filter out more or less than intended, based on scope of things vs. GA limitations in general. Be sure to read the docs and have a very clear understanding about filters and segments! – CrayonViolent Mar 11 '15 at 23:12
1

For anyone finding this thread in 2022, there is now an option to create a Data-deletion request in GA4 Analytics with several options.

Details here: https://support.google.com/analytics/answer/9940393?hl=en

Though it's still somewhat limited and you "schedule" it so it can take some time to actually run.

dmisljen
  • 103
  • 1
  • 4