-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add conversion_rate to sources api and source table #1299
Add conversion_rate to sources api and source table #1299
Conversation
e317022
to
1d006ac
Compare
@ukutaht - Any feedback on if this is the correct way to go about getting the conversion rate, and if there is anything I can do to make the elixir code nicer. Once you're happy with that, then I can update tests, changelog, docs, etc. |
1d006ac
to
668afa0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ro-savage !
Don't know what you were talking about in the other thread, your Elixir looks good!
Tests are missing, I'm happy to take it from here or I can also leave it up to you. Let me know
@@ -49,3 +49,7 @@ export function durationFormatter(duration) { | |||
return `${seconds}s` | |||
} | |||
} | |||
|
|||
export function percentageFormatter(num) { | |||
return +(Math.round(num + "e+2") + "e-2"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spotting. This can be removed now.
It rounds to 2 decimals places, and was left over from when I was calculating the % in the react app.
Thanks @ukutaht - I'll add give adding the tests a go over the weekend and if I get stuck hand it over to you. |
Sounds good :) |
@ukutaht - This should be ready to go if you are happy with the tests. I also added the CR to the modals, and I changed the naming convention and style for the 'should show' function to match what you already had in the app. Do you think the docs need to be updated as well? I had a look, and it seems like you usually don't mention changes that occur from filters, so I thought it probably wasn't required? |
631d4e3
to
dcfb142
Compare
nice work, thanks @ro-savage! would it be possible to add the CR to the top pages as well to make it all consistent? the original feature request mentions both sources and pages. i assume when you click on "details" you also see the CR for all the other sources and not only the top sources? curious to play around with this and test it. wondering if it looks too busy on the main screen or not. normally we hide the other metrics behind the "details" screen and don't show them immediately but perhaps for this one it might work no need to change the docs at this stage |
@metmarkosaric - Thanks for the feedback.
The reason I think CR is highly valuable, at least for a SASS company like mine, is the most important metric we have for our marketing site is "Where did the visitors come from and did they sign up" this lets us focus our marketing spend in the right place. We choose to do our marketing without using any pixel tracking, or in fact any form of tracking beyond UTM. Because of our privacy-focused marketing, UTM becomes the most important and only thing, we can use to ensure we are targeting the right audience. Be that Google Adwords, LinkedIn campaigns, blog content, or sponsors posts. Therefore CR is the metric I (personally) want to see the most when looking at the analytics. |
Sounds good, thanks! I will definitely find this addition useful myself as well so no worry about the usefulness of this. I value it! I meant it more in terms of design layout - we'll need to test how it looks on mobile devices, on sites with a lot of traffic, on referral sources/pages that are longer... but for sure the addition of CR will be very useful.
Yeah, CR for pages will definitely be useful for some of the users. It all depends on how you've set goals up. Some might mostly focus on external referrers but some might also look at learning more and optimizing the conversion rate from internal referrers/pages where they have those goals setup. You can see for instance the public dashboard of Elementary OS and there having access to which internal pages drive best CR would be very interesting https://plausible.io/elementary.io?goal=Payment |
Sorry @ro-savage I'm on holiday so this will go slow... don't have time to test/put it on staging at the moment. re: CR for top pages. Hopefully it doesn't get confusing between top pages and entry pages. The natural thing to show in Top pages is how well the page itself is converting. For example, this would be useful to see which blog posts are convincing people to sign up to the blog newsletter on our live demo: https://plausible.io/plausible.io?period=30d&goal=Newsletter+signup. If you look at our Signup event, the Top Pages report is pretty pointless: https://plausible.io/plausible.io?period=30d&goal=Signup. It will probably just show a very high conversion rate for So that is to say that CR is needed for both Top Pages and Entry Pages. @ro-savage if you're willing to work on this go ahead but there's no pressure. I'm happy to merge this as is and take it from here as well. It will be much slower that way, though :) |
exactly! depending on the site/goals tracked/situation, either of these three could be the most valuable metric that people care about the most (CR for referrals, top pages or entry pages) |
@ukutaht - My preference would be to merge this, and then create a new PR to add CR to the "Pages" card (and then potentially the "Devices" card). However, happy to add it in this PR if you prefer. Finding time for me is a bit hard (I'm also a founder and finding time to contribute to open-source projects rather than focusing on my own small startup isn't easy, doubly so when its a new language!) - and leaving something in Limbo that that is basically complete (useful, tested, and reviewed) would seem a shame. I'll leave it with you to decide :) |
@ro-savage As a developer I like the idea of doing it piecemeal but we discussed it with Marko and he made a good point. There are a lot of eyes on the project and we want to start announcing features in a relatively complete state. So, sorry but I'll wait until I can also add CR to the pages card before merging it |
@ukutaht @metmarkosaric - I have now added the CR to all the panels, including the pages and details. Video: https://www.loom.com/share/50c81e77bdea474aaa01f43873334abd I ended up adding them to every panel as it seemed weird that it would just be available in some of the panels, and it may turn out to be useful to know the CRs for countries or devices. (E.g. maybe you shouldn't target people on mobile devices or people from Australia) I haven't been able to manually test for countries (wasn't sure how to fake this with curl) but it should work. I've also updated the tests to include goal filtering tests that include checks of the cr. Let me know if any other changes are required. |
this looks great @ro-savage, thank you! looking forward to trying it out on our staging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, more than we could ask for! The code looks good to me as well.
This PR really highlights the amount of duplication we have in the dashboard code :) Thanks for making through it all.
* Add conversion_rate to sources api and source table * Remove percentageFormatter * Update source tests to include conversionat rate * Add CR to detals modal * Correct formatting with linter * Add change log * Add CR to Pages, Device and Countries panels
Changes
As per #1296 and #1115 this adds the conversation rate to the Top Sources table when filtering by a goal.
The API will only return the conversion_rate when a goal filter has been applied.
Screenshots
Tests
Changelog
Documentation