Skip to content

Conversation

@astansler
Copy link
Member

No description provided.

@astansler astansler self-assigned this Sep 28, 2017
@astansler astansler requested a review from sergey48k September 28, 2017 02:50
Copy link
Member

@sergey48k sergey48k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good overall, but I want to see another iteration.

@@ -0,0 +1,95 @@
package app
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

header

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

private val fuelManager = FuelManager()

var uuid: String = "" // Should be set on start of the app.
var username: String = "" // Should be set on success authorization.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

successful?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

post(params + defaultParams.filter { !params.contains(it) }
+ idParams).responseString()
} catch (e: Throwable) {
// Never fail from analytics.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add some sort of log/console output here, at least.

try {
// Send event to GA with united params.
post(params + defaultParams.filter { !params.contains(it) }
+ idParams).responseString()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird line breakdown

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

return fuelManager.request(Method.POST, "/collect", params)
}

private fun trackEvent(event: String, params: List<Param> = listOf()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment that explains how exactly this is being logged? E.g. if it's virtual urls, can you explain how it will map to virtual urls? I also suggest all virtual urls start with /virtual prefix as a convention.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.


fun trackError() {
// TODO(anatoly): Send message with exd, consider limit 150 bytes.
trackEvent("/error", listOf("t" to HIT_EXCEPTION))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there should be some sort sort of error code as an argument for trackError, e.g.

/virtual/app/error/out-of-disk-space

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todo is about it.

}

fun trackEnd() {
trackEvent("/end")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this app-exit? :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah.

fun trackError() {
// TODO(anatoly): Send message with exd, consider limit 150 bytes.
trackEvent("/error", listOf("t" to HIT_EXCEPTION))
trackEvent("error", listOf("t" to HIT_EXCEPTION))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally, you don't want to change your logged events because those that are logged will stay in GA forever. So any change to log format, like renaming events, will impact funnels and their historical availability. I will let this one slip this one time, but please follow up with detailed error codes asap.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to use special error tracking software, e.g. https://sentry.io, because error code is not enough.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For GA error urls probably best solution is to use exception names, agree?

@astansler astansler merged commit bd18eb5 into master Oct 2, 2017
@astansler astansler deleted the dev-ga branch October 2, 2017 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants