Google Analytics - Automatic crash/exception tracking

I have implemented Google Analytics using @britzl’s extension: https://github.com/britzl/defold-googleanalytics

It works when I trigger my custom events and I can find the details in Analytics. However, now I recently enabled the automatic crash/exception tracking I can’t figure out if error logging isn’t working or if I just don’t know how or where to find it.

You can see in this output that a) there has been an error, and b) Google Analytics has sent a hit:
image

However, in Analytics I don’t see anything related to the error (I have scoured the other pages as well and can’t find anything):
image

In contrast, when I trigger one of my custom events then things show up as expected:
image

I thought Err was interfering by somehow intercepting the error call, but I disabled it and it doesn’t make a difference.

I don’t really know what the next step is (setting something up in Analytics?) so if anyone has any insight I’d appreciate it.

1 Like

Google analytics send only engine crashes. You should send lua error by yourself.

Somethink like this.

sys.set_error_handler(function(source, message, traceback)
		--do not send same message
		self.exception_prev_time = self.exception_prev_time or 0
		if (self.exception_prev == message and (os.time() - self.exception_prev_time) < 60 * 1) then

		else
			GA.exception(JSON.encode({ source = source, message = message, traceback = traceback }, false));
			self.exception_prev = message
			self.exception_prev_time = os.time()
		end
1 Like

Sorry i was wrong. It use sys.set_error_handler() inside.

Mb something override sys.set_error_handler.
Try send it by yourself.

1 Like

Also there are no default view for exception. You need create custom report to see exceptions. =)

1 Like

Thanks - your last post was the solution!

For future generations uncovering this lost knowledge…

image

image

image

4 Likes

Thanks for sharing! I updated the instructions for the exception to include this.

3 Likes