Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event tracking: remove "example.com" url. #194

Closed
ferenclakos opened this issue Oct 11, 2017 · 15 comments
Closed

Event tracking: remove "example.com" url. #194

ferenclakos opened this issue Oct 11, 2017 · 15 comments

Comments

@ferenclakos
Copy link

Hi!

I would like use the event tracking but have a problem.

We can see the events on the dashboard but we would like remove the "example.com" url from actions.
As I have seen it has been hard coded into source code.

event_tracking_problem

Could you please provide a possibility to change this url?

Thanks.

@rdani91
Copy link

rdani91 commented Oct 11, 2017

We have this similar problem too.
Our system requires to set a specific domain, but we couldn't find the possibility to do that.

@thbaja
Copy link

thbaja commented Oct 11, 2017

You can create your own custom events where you can set the URL as described here.

But it would be nice to be able to set a base URL once, maybe in configureSharedInstance (not to be confused with the baseURL tracking endpoint).And then screen names would use this url as the base when tracking page views (PiwikTracker.shared?.track(view: ["path","to","your","page"]))

And similar behaviour when tracking events. Ie. the url sent with the event would be this base url, along with optional screen names.

@YvesCandel
Copy link

YvesCandel commented Oct 11, 2017

Is the URL necessary? I would rather just leave it empty/null by default... the Android SDK works like that it seems.

@brototyp
Copy link
Member

I think the easiest way for now would be to add a url parameter to the event tracking function. This would be consistent with tracking a view (where you can already do that).

Additionally I like the idea of defining the "http://example.com" once and we use it to generate the url if none is given.

As described here the url is a required field. @mattab Is this really the case? Is it possible to ditch the url since in most/some cases one on mobile there aren't urls matching the content in the app?

@YvesCandel
Copy link

We're seeing this from our Android app:

screen shot 2017-10-12 at 09 42 44

...and this from our iOS app:

screen shot 2017-10-12 at 09 42 52

This somehow makes me doubt that the url is a required field...

@mattab
Copy link
Member

mattab commented Oct 12, 2017

@brototyp Turns out in reality the URL is not required and actually optional. Fixed the developer documentation in: matomo-org/developer-documentation#195

You can therefore make it optional in the SDK 👍

@brototyp
Copy link
Member

Hi @mattab, great news. Then the only question is, if we want to keep the "auto url generation"-method, or if it can be defined per view- oder event-tracking and be not set per default. I think I like the latter most, since the default mechanism will probably very rarely be correct.

@mattab
Copy link
Member

mattab commented Oct 13, 2017

It would be helpful in general to be consistent between SDKs, especially with Android SDK so the generated data is similar.
->Can you define the current "auto url generation" - how does it work and how helpful is it?

@brototyp
Copy link
Member

That is a good point. As far as I can see, the Android SDK derives the base url from the app identifier and then uses the action path as the url path. Currently we do the same, but use "example.com" as base url. We could, without an issue, do the same in the iOS SDK.

Still, I am not sure if we should go this way. This only makes sense, if the action path in the app is semantically the same as the url path. I don't think it makes sense to expect that as a default.

@mattab
Copy link
Member

mattab commented Oct 15, 2017

Still, I am not sure if we should go this way. This only makes sense, if the action path in the app is semantically the same as the url path. I don't think it makes sense to expect that as a default.

What would be the alternatives? (IMHO the option "No url" at all is not useful, so wondering if there are other options)

Otherwise sounds good to use same technique as the Android SDK ("derive the base url from the app identifier")

@brototyp
Copy link
Member

I am thinking the other way round: What information do we want to add, when we add a URL to a tracked view or event. From an app's perspective, the only thing I can see (please correct me if I am wrong) is to match a certain app-content to a content that is also available on the web.

If we generate a url from data that we push to the server anyways (for example if the path is generated from the action segments), we don't add any information and there will be barely a case where the autogenerated url matches a real content from the web. I this case I think there is no use in just sending "some url".

Am I wrong here with my thoughts?

@thbaja
Copy link

thbaja commented Oct 18, 2017

Agreed, I think most use cases is to match app-content with web-content.

And when doing event tracking, it would be nice to be able to just pass in an 'An array of hierarchical screen names' as is the case with screen view tracking. Preferably without having to enter a base url everytime, since that doesn't change.

@brototyp
Copy link
Member

What do you think about the following plan: We start by merging this pull request: #195

It simply removes the example.com domain. And in a different Ticket we sketch out if we want to have automatic url generation and the necessities for it.

@brototyp
Copy link
Member

The implementation was merged and is part of the next release.

@brototyp
Copy link
Member

I just found out that the backed behaves differently from what I thought, especially for page views. I changed my proposal here: #197. I am open for different views on the topic.

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

No branches or pull requests

6 participants