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

Referral Tracking #169

Closed
Siddhant-k opened this issue Oct 2, 2020 · 15 comments
Closed

Referral Tracking #169

Siddhant-k opened this issue Oct 2, 2020 · 15 comments
Milestone

Comments

@Siddhant-k
Copy link

Siddhant-k commented Oct 2, 2020

Currently learning Ackee and also using GoatCounter on the side. If I send out a URL:

https://example.com?ref=source

Goat Counter correctly shows the referral came from "source." These do not come up in Ackee, and I sometimes just have "No Referrers" in the past 24 hours if there weren't any other external links to my page.

I currently use this for static links that I send out to see which version that I'm sending is doing better. Kind of like A/B testing, but more manual.

Is this expected behavior within Ackee?

Thanks for making such a minimal and private tracker. I have enjoyed using it so far!

@electerious
Copy link
Owner

Ackee removes the ref and source parameters, but I guess we can use them as a fallback when there's no referrer. Do you have some URL examples? Is the source just name or a URL?

@Siddhant-k
Copy link
Author

Hi!

That's good to know. I might have missed that when I was going through the code.

I am sending out PDFs and doing manual A/B testing, so I would code my URL (after '?ref=') with the an internal name and the date, for example:

https://example.com?ref=Coda_2020-10-06
https://example.com?ref=Vanilla_2020-10-04

The general template follows:
https://url.com?ref=CodeName_DateSentOut

So I manually see how many referrals I got from a particular version. Does that make sense?

@electerious
Copy link
Owner

So referrers and referrals are two different things. ref allows to distinguish views even when they're from the same referrer, which makes it good for A/B testing. Is that correct?

I'm not familiar with the concept and therefore not sure what's the best way to integrate them. Having referrers and referrals in the UI could be confusing. I couldn't find it in the Goat Counter demo. Can you share a screenshot?

@Siddhant-k
Copy link
Author

Siddhant-k commented Oct 20, 2020

I think you are absolutely correct. Apologies for the mixed up usage of referral and referrer terminology.

You are correct, ref allows to distinguish views even when they are from the same referrer.

Sure, here is an example from Goat Counter that I am referring to:

This is from the Goat Counter Live Demo:
Screen Shot 2020-10-19 at 10 30 03 PM

This is what I see in my Goat Counter instance:
Screen Shot 2020-10-08 at 12 55 07 PM

"Effhzf.." referrers are not connected to what I'm trying to do and are just random referrers.

I used the following links to go to my website:

and that's how "test" and "realTest" showed up in the referrers section in Goat Counter. I am trying to have the same referrers also show up in Ackee.

I hope this makes more sense. More that I think about it, I meant referrers instead of referrals. Apologies for the mix up again!

@BetaHuhn
Copy link
Contributor

Ackee removes the ref and source parameters, but I guess we can use them as a fallback when there's no referrer.

If no referrer header is present, I think Ackee should not only check for a ref and source parameter, but also utm_source.

Further I think it would be great if Ackee could also track what medium and/or campaign a user is coming from with the utm_medium and utm_campaign parameters. If I am sharing a link in an email campaign for example I could add them to the link like this: yourdomain.com?utm_source=Newsletter&utm_medium=Email&utm_campaign=OctoberNewsletter

As a reference, here's how Plausible Analytics does this.

Ackee would also need to display all of them in the dashboard. In my opinion the best way would be to show the ref, source and utm_source parameters in the referrer list as if they are actual referrers and utm_medium and utm_campaign only as a filter option.

@electerious What do you think? I'd be happy to give it a try on implementing this!

@Siddhant-k
Copy link
Author

I think this is a great idea! This is exactly what I'm trying to accomplish and was trying to explain before.

I'd also be happy to give it a try on implementing this!

@electerious
Copy link
Owner

This sounds great! I would go with ref, source and utm_source for now. We could still add utm_medium and utm_campaign later. We could add the others later. Let's make small steps.

An implementation of this is welcome. Please make sure to use the develop as a base.

What I would like to discuss first:

referrer currently needs to be a URL. We could simply allow any kind of string in the referrer field (and detect if it's a URL when it starts with http) or we could store ref, source and utm_source together in a new field and later return both under Referrers. It might be helpful to have the information that something is a URL and real referrer. The GraphQL API could then return both the URL scalar and String scalar. This way Ackee also knows if it should link an entry or not.

Not sure if that's necessary or possible, but that just came into my mind.

@BetaHuhn
Copy link
Contributor

BetaHuhn commented Oct 23, 2020

Which way would you prefer? Use the value of ref, source and utm_source and add it to the existing siteReferrer field or add a new field like utmSource?

If we use the existing siteReferrer how is the information that it is a real referrer (a URL) or just a string stored? We can't just change it to an object with a value and isUrl property as this would break backwards compatibility.

I think creating a new field like utmSource would be a better solution, as it would be consistent if utm_medium and utm_campaign are added later, it also wouldn't impact current users.

Also if we go for the second option how should Ackee return the fields via the API/show them in the UI?

@electerious
Copy link
Owner

Let's use a new field called source that will be a string containing ref, source and utm_source. I would prefer a back-end implementation before adding it to the UI (smaller PRs instead of a big one are always better to review).

Also if we go for the second option how should Ackee return the fields via the API/show them in the UI?

My suggestion would be to aggregate them together with the referrers (= referrers include sources). The list in the UI would then contain text and URLs. I could create a custom favicon for them so it's possible to distinguish them from the domains. The GraphQL API can also return referrers together with sources. The Id currently uses a URL scalar and could return a union (union ReferrerId = URL | String) instead.

@BetaHuhn
Copy link
Contributor

Okay, I added the source field and aggregated it with the referrers (#173 ). So when quering the API for referrers, the source field gets returned alongside the normal referrers.

I am having trouble figuring out how to change the URL scalar to a union in the GraphQL API as I am not ver familiar with this.

@BetaHuhn
Copy link
Contributor

Hey @electerious, when are planning on merging #185 and the feature/source branch? Do I have to wait until #40 is done and v2.5 is released? Can you roughly tell me when I can expect this to be included in Ackee?

I need it badly, but don't want to switch my Ackee instance away from master if I don't have to. 😄

Thanks! 🙏

@electerious
Copy link
Owner

Switching away from the master is the best solution right now as I will focus on shipping #40.

@electerious electerious added this to the v3.0.0 milestone Dec 31, 2020
@electerious
Copy link
Owner

I've merged the PRs. It's now a part of v3 (not released, yet).

@electerious
Copy link
Owner

The current implementation uses the source when no referrer is present and allows you to show and hide sources. I'm not sure if that's the best way, because you will never see the source when there's a referrer.

@BetaHuhn Any idea how to improve this? Should we show sources as an extra insight instead of making them a part of the referrers? Another idea would be to show a record with a referrer and source as two entries, but that might require a few changes in the aggregation.

@electerious
Copy link
Owner

The feature has been adjusted. It now supports ?source only and uses the source parameter instead of the referrer when available.

  • UTM is something different. It needs more than a simple list because UTM also has parameters like medium, source and campaign. Ackee isn't for those who are looking for a full featured marketing analytics platform. I therefore removed the utm_source support.
  • ?source will be used instead of the referrer when available. I've used ?source because some sites are already using ?ref (like ProductHunt). In this case it's better to use a less common parameter as I don't want that sites are overwriting the referrer with something like producthunt.

Screenshot 2021-01-02 at 17 23 09

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

3 participants