{"id":19261568,"url":"https://github.com/emilydaykin/ab-testing","last_synced_at":"2025-02-23T18:29:19.592Z","repository":{"id":256217167,"uuid":"596661888","full_name":"emilydaykin/ab-testing","owner":"emilydaykin","description":"🎭 A NextJS web app that displays one of two versions/designs of the landing page (A or B) to the user. Tracks page views and click activity, and stores user information in localStorage.","archived":false,"fork":false,"pushed_at":"2023-02-02T19:33:13.000Z","size":3499,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-05T10:09:34.046Z","etag":null,"topics":["abtesting","localstorage","nextjs","sass","vercel"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emilydaykin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-02T17:07:47.000Z","updated_at":"2023-02-09T20:39:07.000Z","dependencies_parsed_at":"2024-09-09T17:20:38.409Z","dependency_job_id":"89399d89-3ef9-4637-820b-acebe7eb829f","html_url":"https://github.com/emilydaykin/ab-testing","commit_stats":null,"previous_names":["emilydaykin/ab-testing"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilydaykin%2Fab-testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilydaykin%2Fab-testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilydaykin%2Fab-testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilydaykin%2Fab-testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emilydaykin","download_url":"https://codeload.github.com/emilydaykin/ab-testing/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240358497,"owners_count":19788907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abtesting","localstorage","nextjs","sass","vercel"],"created_at":"2024-11-09T19:27:32.465Z","updated_at":"2025-02-23T18:29:19.548Z","avatar_url":"https://github.com/emilydaykin.png","language":"JavaScript","readme":"# A/B Testing Challenge\n\n## Acceptance Criteria\n\nImplement the following logic while keeping the broader goal in mind:\n\n1. A visitor sees only one variation (assigned randomly) when they land on the page.\n\n2. The assigned variation doesn’t change after page reload.\n\n3. Track a pageview via the `analytics-api.js` methods when a visitor lands on the page.\n\n4. Track an event via the `analytics-api.js` methods when a visitor clicks on the “Sign up” button.\n\n5. Every single pageview and click is tracked.\n\n6. We want to determine a winning variation by comparing CTR (click-through rate) of clicks on the “Sign up” button. The CTR of a page is \"number of clicks\" divided by \"number of page views\". As a user can only effectively convert (sign up) once, the counts for the CTR computation need to be unique per user. This means a single user clicking ten times and reloading the page 5 times should only count towards one conversion. Make sure this is possible with the data you send and explain on a high level how.\n\n## Delivery\n### A/B Design:\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"public/A_design.png\" width=\"49.85%\"  /\u003e\n  \u003cimg src=\"public/B_design.png\" width=\"46.5%\"  /\u003e\n\u003c/p\u003e\n\n### Implementation:\n- NextJS, Sass (BEM), and Vercel were used to create, style and host this application.\n- `localStorage`, `uuidv4` were used to differentiate between visitors, site versions, and track events (page view and sign-up click).\n\n### Deployed application:\n- [Link](https://ab-testing-blinkist-edaykin.vercel.app/)\n- To play around with the logic, open the developer tools\n  - Use the Console tab to view the API logs whenever the page is visited or revisited (refreshed), or the sign up button is clicked\n  - Use the Application tab \u003e Storage \u003e Local Storage to see what gets saved to Local Storage. To simulate visiting the page as a new/different user, clear the local storage (delete all entries) then refresh the page.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femilydaykin%2Fab-testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femilydaykin%2Fab-testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femilydaykin%2Fab-testing/lists"}