{"id":"youtube:86lW_o3tadg","source":"youtube","sourceId":"86lW_o3tadg","account":"robotostudio","type":"video","title":"A/B testing in Sanity Studio with PostHog","body":"A quick walkthrough of A/B testing a hero button with Sanity Studio and PostHog. Set up control and variant pages in Sanity, ship them to users, and read exposures and clicks per user in PostHog.","bodyFormat":"text","sourceUrl":"https://www.youtube.com/watch?v=86lW_o3tadg","canonicalUrl":"https://robotostudio.com/videos/a-b-testing-in-sanity-studio-with-posthog","sourceUrls":["https://robotostudio.com/videos/a-b-testing-in-sanity-studio-with-posthog"],"authorIds":[],"publishedAt":"2026-09-22T00:00:00.000Z","checkedAt":"2026-10-26T04:00:25.839Z","language":"en","visibility":"public","topics":["sanity"],"gaps":[],"segments":[{"id":"segment-1","startMs":4350,"endMs":4360,"text":"Hey, how's it going?"},{"id":"segment-2","startMs":4360,"endMs":6350,"text":"Hey, how's it going?\nIn today's video, I'm going to show you"},{"id":"segment-3","startMs":6350,"endMs":6360,"text":"In today's video, I'm going to show you"},{"id":"segment-4","startMs":6360,"endMs":9150,"text":"In today's video, I'm going to show you\nAB testing with Sanity Studio and"},{"id":"segment-5","startMs":9150,"endMs":9160,"text":"AB testing with Sanity Studio and"},{"id":"segment-6","startMs":9160,"endMs":10430,"text":"AB testing with Sanity Studio and\nPostHog."},{"id":"segment-7","startMs":10430,"endMs":10440,"text":"PostHog."},{"id":"segment-8","startMs":10440,"endMs":12750,"text":"PostHog.\nSo, in this video, I'm going to show you"},{"id":"segment-9","startMs":12750,"endMs":12760,"text":"So, in this video, I'm going to show you"},{"id":"segment-10","startMs":12760,"endMs":16030,"text":"So, in this video, I'm going to show you\na very cool example of a button hero"},{"id":"segment-11","startMs":16030,"endMs":16040,"text":"a very cool example of a button hero"},{"id":"segment-12","startMs":16040,"endMs":17830,"text":"a very cool example of a button hero\nthat we built internally."},{"id":"segment-13","startMs":17830,"endMs":17840,"text":"that we built internally."},{"id":"segment-14","startMs":17840,"endMs":20150,"text":"that we built internally.\nAnd I will show you how easily you can"},{"id":"segment-15","startMs":20150,"endMs":20160,"text":"And I will show you how easily you can"},{"id":"segment-16","startMs":20160,"endMs":23270,"text":"And I will show you how easily you can\nset your own test and check the results"},{"id":"segment-17","startMs":23270,"endMs":23280,"text":"set your own test and check the results"},{"id":"segment-18","startMs":23280,"endMs":25350,"text":"set your own test and check the results\non PostHog."},{"id":"segment-19","startMs":25350,"endMs":25360,"text":"on PostHog."},{"id":"segment-20","startMs":25360,"endMs":27150,"text":"on PostHog.\nSo, as you can see on my screen, I've"},{"id":"segment-21","startMs":27150,"endMs":27160,"text":"So, as you can see on my screen, I've"},{"id":"segment-22","startMs":27160,"endMs":29430,"text":"So, as you can see on my screen, I've\nset up my test on Sanity, and this is"},{"id":"segment-23","startMs":29430,"endMs":29440,"text":"set up my test on Sanity, and this is"},{"id":"segment-24","startMs":29440,"endMs":32030,"text":"set up my test on Sanity, and this is\nthe AB testing space where I've added my"},{"id":"segment-25","startMs":32030,"endMs":32040,"text":"the AB testing space where I've added my"},{"id":"segment-26","startMs":32040,"endMs":34430,"text":"the AB testing space where I've added my\ncontrol and my other one. I called it"},{"id":"segment-27","startMs":34430,"endMs":34440,"text":"control and my other one. I called it"},{"id":"segment-28","startMs":34440,"endMs":37950,"text":"control and my other one. I called it\nblue. Essentially, it's a black button."},{"id":"segment-29","startMs":37950,"endMs":37960,"text":"blue. Essentially, it's a black button."},{"id":"segment-30","startMs":37960,"endMs":40150,"text":"blue. Essentially, it's a black button.\nAnd the other thing is I have pages for"},{"id":"segment-31","startMs":40150,"endMs":40160,"text":"And the other thing is I have pages for"},{"id":"segment-32","startMs":40160,"endMs":42830,"text":"And the other thing is I have pages for\nblack and white as well. And you can set"},{"id":"segment-33","startMs":42830,"endMs":42840,"text":"black and white as well. And you can set"},{"id":"segment-34","startMs":42840,"endMs":45030,"text":"black and white as well. And you can set\nas many pages in in your particular case"},{"id":"segment-35","startMs":45030,"endMs":45040,"text":"as many pages in in your particular case"},{"id":"segment-36","startMs":45040,"endMs":46470,"text":"as many pages in in your particular case\nas you want."},{"id":"segment-37","startMs":46470,"endMs":46480,"text":"as you want."},{"id":"segment-38","startMs":46480,"endMs":48350,"text":"as you want.\nNow, I'll show you exactly how this"},{"id":"segment-39","startMs":48350,"endMs":48360,"text":"Now, I'll show you exactly how this"},{"id":"segment-40","startMs":48360,"endMs":51070,"text":"Now, I'll show you exactly how this\nlooks. So, the user will see this, and"},{"id":"segment-41","startMs":51070,"endMs":51080,"text":"looks. So, the user will see this, and"},{"id":"segment-42","startMs":51080,"endMs":52670,"text":"looks. So, the user will see this, and\nwhat they can do is they can click on"},{"id":"segment-43","startMs":52670,"endMs":52680,"text":"what they can do is they can click on"},{"id":"segment-44","startMs":52680,"endMs":56630,"text":"what they can do is they can click on\nthis button. And you can see the total"},{"id":"segment-45","startMs":56630,"endMs":56640,"text":"this button. And you can see the total"},{"id":"segment-46","startMs":56640,"endMs":59510,"text":"this button. And you can see the total\nclicks changing on the screen."},{"id":"segment-47","startMs":59510,"endMs":59520,"text":"clicks changing on the screen."},{"id":"segment-48","startMs":59520,"endMs":62950,"text":"clicks changing on the screen.\nAnd if I refresh it, hopefully, I get a"},{"id":"segment-49","startMs":62950,"endMs":62960,"text":"And if I refresh it, hopefully, I get a"},{"id":"segment-50","startMs":62960,"endMs":65750,"text":"And if I refresh it, hopefully, I get a\ndifferent variation to show you guys."},{"id":"segment-51","startMs":65750,"endMs":65760,"text":"different variation to show you guys."},{"id":"segment-52","startMs":65760,"endMs":67390,"text":"different variation to show you guys.\nThere we go. So, we've got the black"},{"id":"segment-53","startMs":67390,"endMs":67400,"text":"There we go. So, we've got the black"},{"id":"segment-54","startMs":67400,"endMs":68910,"text":"There we go. So, we've got the black\none."},{"id":"segment-55","startMs":68910,"endMs":68920,"text":"one."},{"id":"segment-56","startMs":68920,"endMs":70470,"text":"one.\nClick a bunch of time."},{"id":"segment-57","startMs":70470,"endMs":70480,"text":"Click a bunch of time."},{"id":"segment-58","startMs":70480,"endMs":73270,"text":"Click a bunch of time.\nAnyway, so you can do this for any use"},{"id":"segment-59","startMs":73270,"endMs":73280,"text":"Anyway, so you can do this for any use"},{"id":"segment-60","startMs":73280,"endMs":75670,"text":"Anyway, so you can do this for any use\ncase for different variations. You can"},{"id":"segment-61","startMs":75670,"endMs":75680,"text":"case for different variations. You can"},{"id":"segment-62","startMs":75680,"endMs":77590,"text":"case for different variations. You can\ndo it for form clicks. You can do it for"},{"id":"segment-63","startMs":77590,"endMs":77600,"text":"do it for form clicks. You can do it for"},{"id":"segment-64","startMs":77600,"endMs":79790,"text":"do it for form clicks. You can do it for\ndifferent pages. Whatever suits your"},{"id":"segment-65","startMs":79790,"endMs":79800,"text":"different pages. Whatever suits your"},{"id":"segment-66","startMs":79800,"endMs":81230,"text":"different pages. Whatever suits your\nneeds."},{"id":"segment-67","startMs":81230,"endMs":81240,"text":"needs."},{"id":"segment-68","startMs":81240,"endMs":83230,"text":"needs.\nAnd I'll show you how this looks on the"},{"id":"segment-69","startMs":83230,"endMs":83240,"text":"And I'll show you how this looks on the"},{"id":"segment-70","startMs":83240,"endMs":86350,"text":"And I'll show you how this looks on the\nPostHog side. So,"},{"id":"segment-71","startMs":86350,"endMs":86360,"text":"PostHog side. So,"},{"id":"segment-72","startMs":86360,"endMs":88350,"text":"PostHog side. So,\nthis is my particular demo."},{"id":"segment-73","startMs":88350,"endMs":88360,"text":"this is my particular demo."},{"id":"segment-74","startMs":88360,"endMs":92070,"text":"this is my particular demo.\nAs you can see, total exposure is 125."},{"id":"segment-75","startMs":92070,"endMs":92080,"text":"As you can see, total exposure is 125."},{"id":"segment-76","startMs":92080,"endMs":94470,"text":"As you can see, total exposure is 125.\nThis is pretty simple stuff. Like, you"},{"id":"segment-77","startMs":94470,"endMs":94480,"text":"This is pretty simple stuff. Like, you"},{"id":"segment-78","startMs":94480,"endMs":97430,"text":"This is pretty simple stuff. Like, you\nknow, 125 times this was exposed to"},{"id":"segment-79","startMs":97430,"endMs":97440,"text":"know, 125 times this was exposed to"},{"id":"segment-80","startMs":97440,"endMs":98590,"text":"know, 125 times this was exposed to\npeople."},{"id":"segment-81","startMs":98590,"endMs":98600,"text":"people."},{"id":"segment-82","startMs":98600,"endMs":100950,"text":"people.\nAnd I have my control, and I have my"},{"id":"segment-83","startMs":100950,"endMs":100960,"text":"And I have my control, and I have my"},{"id":"segment-84","startMs":100960,"endMs":103030,"text":"And I have my control, and I have my\nblue. I called the other one blue, but"},{"id":"segment-85","startMs":103030,"endMs":103040,"text":"blue. I called the other one blue, but"},{"id":"segment-86","startMs":103040,"endMs":104510,"text":"blue. I called the other one blue, but\nit's essentially is a black button. I"},{"id":"segment-87","startMs":104510,"endMs":104520,"text":"it's essentially is a black button. I"},{"id":"segment-88","startMs":104520,"endMs":106670,"text":"it's essentially is a black button. I\nknow it's a little bit confusing, but"},{"id":"segment-89","startMs":106670,"endMs":106680,"text":"know it's a little bit confusing, but"},{"id":"segment-90","startMs":106680,"endMs":107950,"text":"know it's a little bit confusing, but\nbear with me."},{"id":"segment-91","startMs":107950,"endMs":107960,"text":"bear with me."},{"id":"segment-92","startMs":107960,"endMs":110790,"text":"bear with me.\nSo, as you can see here, on average,"},{"id":"segment-93","startMs":110790,"endMs":110800,"text":"So, as you can see here, on average,"},{"id":"segment-94","startMs":110800,"endMs":113310,"text":"So, as you can see here, on average,\nthere is eight click per person for the"},{"id":"segment-95","startMs":113310,"endMs":113320,"text":"there is eight click per person for the"},{"id":"segment-96","startMs":113320,"endMs":114390,"text":"there is eight click per person for the\ncontrol."},{"id":"segment-97","startMs":114390,"endMs":114400,"text":"control."},{"id":"segment-98","startMs":114400,"endMs":116550,"text":"control.\nAnd on average, there's like nine click"},{"id":"segment-99","startMs":116550,"endMs":116560,"text":"And on average, there's like nine click"},{"id":"segment-100","startMs":116560,"endMs":119070,"text":"And on average, there's like nine click\nper user for blue. But the interesting"},{"id":"segment-101","startMs":119070,"endMs":119080,"text":"per user for blue. But the interesting"},{"id":"segment-102","startMs":119080,"endMs":121430,"text":"per user for blue. But the interesting\nthing is 30"},{"id":"segment-103","startMs":121430,"endMs":121440,"text":"thing is 30"},{"id":"segment-104","startMs":121440,"endMs":125630,"text":"thing is 30\n30 instances or 30 exposure versus 23"},{"id":"segment-105","startMs":125630,"endMs":125640,"text":"30 instances or 30 exposure versus 23"},{"id":"segment-106","startMs":125640,"endMs":128469,"text":"30 instances or 30 exposure versus 23\nexposure is to look at. So, 23 times"},{"id":"segment-107","startMs":128469,"endMs":128479,"text":"exposure is to look at. So, 23 times"},{"id":"segment-108","startMs":128479,"endMs":130350,"text":"exposure is to look at. So, 23 times\nblue button was exposed to the user as"},{"id":"segment-109","startMs":130350,"endMs":130360,"text":"blue button was exposed to the user as"},{"id":"segment-110","startMs":130360,"endMs":132870,"text":"blue button was exposed to the user as\ncompared to 30 times for the control"},{"id":"segment-111","startMs":132870,"endMs":132880,"text":"compared to 30 times for the control"},{"id":"segment-112","startMs":132880,"endMs":137110,"text":"compared to 30 times for the control\nvariation. But on average, nine per nine"},{"id":"segment-113","startMs":137110,"endMs":137120,"text":"variation. But on average, nine per nine"},{"id":"segment-114","startMs":137120,"endMs":140030,"text":"variation. But on average, nine per nine\nclick per user was recorded for the blue"},{"id":"segment-115","startMs":140030,"endMs":140040,"text":"click per user was recorded for the blue"},{"id":"segment-116","startMs":140040,"endMs":142390,"text":"click per user was recorded for the blue\none. So, the blue one or the black"},{"id":"segment-117","startMs":142390,"endMs":142400,"text":"one. So, the blue one or the black"},{"id":"segment-118","startMs":142400,"endMs":144630,"text":"one. So, the blue one or the black\nbutton is winning in our case."},{"id":"segment-119","startMs":144630,"endMs":144640,"text":"button is winning in our case."},{"id":"segment-120","startMs":144640,"endMs":146710,"text":"button is winning in our case.\nAnd you can set"},{"id":"segment-121","startMs":146710,"endMs":146720,"text":"And you can set"},{"id":"segment-122","startMs":146720,"endMs":149070,"text":"And you can set\nyour matrices here. You can look at"},{"id":"segment-123","startMs":149070,"endMs":149080,"text":"your matrices here. You can look at"},{"id":"segment-124","startMs":149080,"endMs":151990,"text":"your matrices here. You can look at\nthem. Look at all the different graphs."},{"id":"segment-125","startMs":151990,"endMs":152000,"text":"them. Look at all the different graphs."},{"id":"segment-126","startMs":152000,"endMs":154390,"text":"them. Look at all the different graphs.\nIn our case, as I mentioned, the blue"},{"id":"segment-127","startMs":154390,"endMs":154400,"text":"In our case, as I mentioned, the blue"},{"id":"segment-128","startMs":154400,"endMs":155949,"text":"In our case, as I mentioned, the blue\none is doing much better than the white"},{"id":"segment-129","startMs":155949,"endMs":155959,"text":"one is doing much better than the white"},{"id":"segment-130","startMs":155959,"endMs":156990,"text":"one is doing much better than the white\none."},{"id":"segment-131","startMs":156990,"endMs":157000,"text":"one."},{"id":"segment-132","startMs":157000,"endMs":159230,"text":"one.\nBut this is a very simple example. But"},{"id":"segment-133","startMs":159230,"endMs":159240,"text":"But this is a very simple example. But"},{"id":"segment-134","startMs":159240,"endMs":161150,"text":"But this is a very simple example. But\nthe whole point of this video is to show"},{"id":"segment-135","startMs":161150,"endMs":161160,"text":"the whole point of this video is to show"},{"id":"segment-136","startMs":161160,"endMs":163670,"text":"the whole point of this video is to show\nyou how easy it is to record this and"},{"id":"segment-137","startMs":163670,"endMs":163680,"text":"you how easy it is to record this and"},{"id":"segment-138","startMs":163680,"endMs":166310,"text":"you how easy it is to record this and\nuse it in your own use case. And yeah,"},{"id":"segment-139","startMs":166310,"endMs":166320,"text":"use it in your own use case. And yeah,"},{"id":"segment-140","startMs":166320,"endMs":168510,"text":"use it in your own use case. And yeah,\nthe tuner again completely open source."},{"id":"segment-141","startMs":168510,"endMs":168520,"text":"the tuner again completely open source."},{"id":"segment-142","startMs":168520,"endMs":170990,"text":"the tuner again completely open source.\nSo, let us know if you know, if you'd"},{"id":"segment-143","startMs":170990,"endMs":171000,"text":"So, let us know if you know, if you'd"},{"id":"segment-144","startMs":171000,"endMs":172630,"text":"So, let us know if you know, if you'd\nlike to try it for yourself and how you"},{"id":"segment-145","startMs":172630,"endMs":172640,"text":"like to try it for yourself and how you"},{"id":"segment-146","startMs":172640,"endMs":175190,"text":"like to try it for yourself and how you\nfound it. And yeah, we love making these"},{"id":"segment-147","startMs":175190,"endMs":175200,"text":"found it. And yeah, we love making these"},{"id":"segment-148","startMs":175200,"endMs":177910,"text":"found it. And yeah, we love making these\nkind of videos. So, give us a thumbs up"},{"id":"segment-149","startMs":177910,"endMs":177920,"text":"kind of videos. So, give us a thumbs up"},{"id":"segment-150","startMs":177920,"endMs":179830,"text":"kind of videos. So, give us a thumbs up\nfor this one. And yeah, see you next"},{"id":"segment-151","startMs":179830,"endMs":179840,"text":"for this one. And yeah, see you next"},{"id":"segment-152","startMs":179840,"endMs":183239,"text":"for this one. And yeah, see you next\ntime. Take care. Bye."}],"transcript":"AB testing with Sanity Studio and PostHog. I'm going to show you a very cool example of a button hero that we built internally and how easily you can set your own test and check the results on PostHog.\n\nAs you can see on my screen, I've set up my test on Sanity. This is the AB testing space where I've added my control and my other one, called it blue. Essentially it's a black button. And the other thing is I have pages for black and white as well. You can set as many pages in your particular case as you want.\n\nNow I'll show you exactly how this looks. The user will see this and what they can do is click on this button, and you can see the total clicks changing on the screen. If I refresh it, hopefully I get a different variation to show you.\n\nThere we go. So we've got the black one. Click a bunch of times. Anyway, you can do this for any use case with different variations. You can do it for form clicks, different pages, or whatever suits your needs. I'll show you how this looks on the PostHog side.\n\nThis is my particular demo. As you can see, total exposure is 125. That's 125 times this was exposed to people. I have my control and I have my blue. I called the other one blue but it's essentially a black button. I know it's a little bit confusing but bear with me.\n\nAs you can see here, on average there's eight clicks per person for the control, and on average there's nine clicks per user for blue. But the interesting thing is 30 versus 23 exposures to look at. So 23 times the blue button was exposed to the user as compared to 30 times for the control variation. But on average, nine clicks per user was recorded for the blue one. So the blue one, or the black button, is winning in our case.\n\nYou can set your metrics here, look at them, look at all the different charts. In our case, as I mentioned, the blue one is doing much better than the white one. But this is a very simple example. The whole point of this video is to show you how easy it is to record this and use it in your own use case.\n\nThe tool is completely open source. Let us know if you'd like to try it for yourself and how you found it. We love making these kinds of videos.","transcriptOrigin":"Edited transcript from the original Roboto page","thumbnailUrl":"https://img.youtube.com/vi/86lW_o3tadg/maxresdefault.jpg","durationSeconds":197,"videoId":"86lW_o3tadg","publisherName":"Roboto Studio","faqs":[{"question":"What is AB testing in Sanity Studio?","answer":"AB testing in Sanity Studio lets you create different variations of content, like buttons with different colors, and serve them to users to see which performs better. You set up a control version and one or more test variations, then track how users interact with each one to determine which wins.","sourceUrl":"https://robotostudio.com/videos/a-b-testing-in-sanity-studio-with-posthog"},{"question":"How do you set up an AB test in Sanity?","answer":"In Sanity's AB testing space, you add your control variation and name your other variations, like we called ours blue. You can also create multiple pages for each variation if you need them. The setup is straightforward and you can customize it for whatever you want to test.","sourceUrl":"https://robotostudio.com/videos/a-b-testing-in-sanity-studio-with-posthog"},{"question":"What metrics does PostHog show for AB tests?","answer":"PostHog displays total exposures, which is how many times a variation was shown to users, and average clicks per user for each variation. You can see these metrics side by side to compare performance between your control and test versions, along with additional charts and data points.","sourceUrl":"https://robotostudio.com/videos/a-b-testing-in-sanity-studio-with-posthog"},{"question":"How can you tell which variation is winning?","answer":"Compare the average clicks per user between your variations. In our example, the blue button had nine clicks per user on average while the control had eight, making the blue variation the winner. PostHog makes it easy to see these numbers and determine which version performs better.","sourceUrl":"https://robotostudio.com/videos/a-b-testing-in-sanity-studio-with-posthog"},{"question":"What kinds of things can you AB test?","answer":"You can test button variations, form clicks, different pages, or really any use case where you want to measure user interaction. The system is flexible enough to accommodate whatever variations you want to compare across your product or site.","sourceUrl":"https://robotostudio.com/videos/a-b-testing-in-sanity-studio-with-posthog"},{"question":"Is this tool free to use?","answer":"Yes, the tool is completely open source, so you can use it without paying for a license. You can set it up for yourself and start running tests right away with no cost barriers.","sourceUrl":"https://robotostudio.com/videos/a-b-testing-in-sanity-studio-with-posthog"},{"question":"How easy is it to track test results?","answer":"Once you set up your variations in Sanity, they automatically feed into PostHog and you can see all your metrics and charts immediately. The whole process from setup to viewing results is designed to be straightforward so you can focus on what the data tells you about user behavior.","sourceUrl":"https://robotostudio.com/videos/a-b-testing-in-sanity-studio-with-posthog"}],"path":"/videos/86lW_o3tadg/a-b-testing-in-sanity-studio-with-posthog","indexable":false,"contentHash":"e3f258198a2061c7a681a0e26af9da4c6b684538f06ef5d40610d246dc90979e","representations":{"html":"https://bestsanityagency.com/videos/86lW_o3tadg/a-b-testing-in-sanity-studio-with-posthog","markdown":"https://bestsanityagency.com/videos/86lW_o3tadg/a-b-testing-in-sanity-studio-with-posthog.md","json":"https://bestsanityagency.com/videos/86lW_o3tadg/a-b-testing-in-sanity-studio-with-posthog.json"},"generation":"5e39adeb9fc695d06857c3e4","jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://robotostudio.com/#organization","name":"Roboto Studio","url":"https://robotostudio.com/","sameAs":["https://clutch.co/profile/roboto-studio","https://www.youtube.com/@robotostudio","https://x.com/studioroboto"]},{"@type":"Person","@id":"https://robotostudio.com/blog/author/jono#person","name":"Jono Alford","url":"https://robotostudio.com/blog/author/jono","sameAs":["https://dev.to/jonoroboto","https://x.com/jonoalford","https://www.reddit.com/user/jonoalford/"],"worksFor":{"@id":"https://robotostudio.com/#organization"}},{"@type":"Person","@id":"https://robotostudio.com/blog/author/sne#person","name":"Sne Tripathi","url":"https://robotostudio.com/blog/author/sne","sameAs":["https://x.com/sne_hil"],"worksFor":{"@id":"https://robotostudio.com/#organization"}},{"@type":"WebSite","@id":"https://bestsanityagency.com/#website","url":"https://bestsanityagency.com","name":"Roboto Studio evidence","publisher":{"@id":"https://robotostudio.com/#organization"}},{"@type":"WebPage","@id":"https://bestsanityagency.com/videos/86lW_o3tadg/a-b-testing-in-sanity-studio-with-posthog#page","url":"https://bestsanityagency.com/videos/86lW_o3tadg/a-b-testing-in-sanity-studio-with-posthog","name":"A/B testing in Sanity Studio with PostHog","publisher":{"@id":"https://robotostudio.com/#organization"},"mainEntity":{"@id":"https://www.youtube.com/watch?v=86lW_o3tadg"},"isPartOf":{"@id":"https://bestsanityagency.com/#website"}},{"@id":"https://www.youtube.com/watch?v=86lW_o3tadg","name":"A/B testing in Sanity Studio with PostHog","url":"https://www.youtube.com/watch?v=86lW_o3tadg","datePublished":"2026-09-22T00:00:00.000Z","inLanguage":"en","author":[],"@type":"VideoObject","description":"A quick walkthrough of A/B testing a hero button with Sanity Studio and PostHog. Set up control and variant pages in Sanity, ship them to users, and read exposures and clicks per user in PostHog.","transcript":"AB testing with Sanity Studio and PostHog. I'm going to show you a very cool example of a button hero that we built internally and how easily you can set your own test and check the results on PostHog.\n\nAs you can see on my screen, I've set up my test on Sanity. This is the AB testing space where I've added my control and my other one, called it blue. Essentially it's a black button. And the other thing is I have pages for black and white as well. You can set as many pages in your particular case as you want.\n\nNow I'll show you exactly how this looks. The user will see this and what they can do is click on this button, and you can see the total clicks changing on the screen. If I refresh it, hopefully I get a different variation to show you.\n\nThere we go. So we've got the black one. Click a bunch of times. Anyway, you can do this for any use case with different variations. You can do it for form clicks, different pages, or whatever suits your needs. I'll show you how this looks on the PostHog side.\n\nThis is my particular demo. As you can see, total exposure is 125. That's 125 times this was exposed to people. I have my control and I have my blue. I called the other one blue but it's essentially a black button. I know it's a little bit confusing but bear with me.\n\nAs you can see here, on average there's eight clicks per person for the control, and on average there's nine clicks per user for blue. But the interesting thing is 30 versus 23 exposures to look at. So 23 times the blue button was exposed to the user as compared to 30 times for the control variation. But on average, nine clicks per user was recorded for the blue one. So the blue one, or the black button, is winning in our case.\n\nYou can set your metrics here, look at them, look at all the different charts. In our case, as I mentioned, the blue one is doing much better than the white one. But this is a very simple example. The whole point of this video is to show you how easy it is to record this and use it in your own use case.\n\nThe tool is completely open source. Let us know if you'd like to try it for yourself and how you found it. We love making these kinds of videos.","thumbnailUrl":"https://img.youtube.com/vi/86lW_o3tadg/maxresdefault.jpg","embedUrl":"https://www.youtube.com/embed/86lW_o3tadg","uploadDate":"2026-09-22T00:00:00.000Z","duration":"PT197S","publisher":{"@type":"Organization","name":"Roboto Studio"},"caption":{"@type":"MediaObject","contentUrl":"https://bestsanityagency.com/videos/86lW_o3tadg/a-b-testing-in-sanity-studio-with-posthog.vtt","encodingFormat":"text/vtt"}}]}}