The challenges of analytics on multi-chain web3 apps - Mislav Javor | DEV3
ETH Belgrade Community·Sat, Oct 7, 2023, 12:00 AM
Speaker
Transcript
foreign I'm Miss love um I'm the CEO of dev3 but throughout my career I've been working on solidity development front-end development for web3 apps I'm a co-author of one of the first textbooks on like blockchain development so uh what I'm about to speak now comes from a large body of personal experience designing building and trying to actually monetize like web3 apps to be honest currently analytics in web3 pretty much suck um like and we'll get to why they are but the general consensus is that you're using tools that are not built for the platform that you are deploying on so like Google analytics stuff like that it's not really it's not really let's say blockchain friendly or even privacy friendly which is very important in blockchain so this is our first point so traditional analytics like Google analytics mixed panel amplitude or whatever they track basically email based conversion events so people open up an account or they go to your Shopify store and they purchase whatever you're selling so they use like credit card payment processing emails backend calls and all of these things that we don't really do in web3 they can track that really really well you can attribute your campaigns you can you know track users retarget them all of these fancy things you can do no problem but then once you are at a point where you need to let's say retarget certain wallet owners like let's say I want to retarget everyone whose wallet has a net worth more than like one thousand dollars it's basically impossible without like asking your developer to spend three or four weeks building out an entire framework for for retargeting so the second part of the story is that we do have analytics in blockchain but they're not front-end analytics right they're on chain analytics uh basically what this means is that the analytics that we have now um like Dune like ether scan I would even consider to be partially analytics and insights and all of these things so you can query your blockchain like very very easily and you can find stuff going in and out of addresses but for example like one of the speakers here I think the sponsors on the conference like liquidy an app like that which has many front-ends for a single set of smart contracts it really doesn't work for for them because you know you can see that some contract has been called like a thousand times but you might not know was it 300 times from Front End one and 700 times from Front End two or was it some different type of ratio so uh yeah so basically traditional analytics give you an incomplete story uh on channelytics give you another part of an incomplete story and they don't match very well to be honest you can't really you know combine Google analytics with Dune queries it's not it's not it's not a thing that will look elegant in any way especially if you try to get your marketing team to do it uh and they're maybe not like hackers who can understand like smart contract uh code uh yeah it's it's very very difficult um so the simplest problem that we have is when you have one front end and your app is deployed on one chain so that situation can even be hacked sort of so you can do custom events right you can you can use your mix panel or Google analytics and then you create a custom event which is called transaction completed or whatever and then you wait for the transaction to complete and then this custom event happens first problem there a developer has to do it so for every new custom event that you want to do you have to spend your developers time uh to get them to work on um to get them to work on it the second problem is um you know that these events don't really have access to a lot of metadata it's this custom event unless you really give it your best and try to push like the blockchain call data and all of these things inside uh they don't have the metadata but even if you push like blockchain call data inside the event uh it's not the best thing ever because the tool that you're using like Google analytics or mixpanel doesn't really know what to do with that so it's very hard to make Google analytics understand what's happening on chain when a custom event happens but and this is already quite bad and we are now talking about the simplest case possible for for blockchain analytics so the second the second level of difficulty is uh when you're deploying on many blockchain networks but you still have one front end so like for example this would be most D5 nft apps these days so like uniswap is on on five six networks or how many match 10 I don't know even uh and you know they they are it's still the same front-end but it interacts with a lot of different chains there you have this problem of chain separation right so you can you can track certain things on etherscan but if you want to track them on polygon you should use polygon scan and then your data is never quite combined in a in a cohesive uh cohesive like Hole uh and um and yeah so so this this makes the problem even worse so now if you want to retarget you have to say Okay I want to retarget for this chain for these users but then I have to set up an RPC endpoint or whatever when I'm pushing metadata into a custom event I have to even now present chain information what chain I'm using and also you don't get some very very cool data that you could get with better analytics is for example um what was the gas price at the point when when the event happened so we had this very interesting situation that we were doing this work for a custom client and you know it's uh the the mint went horribly but not because of the problem in marketing or anything but the gas price was super high at that point and people just didn't want to bother because it was like a non-speculative nft mint which was just like a collectible thing that doesn't have any real value so it wasn't worth it for people to spend like 50 bucks to to Mint it but we actually didn't realize it until like a few days later because you know it nowhere in analytics it said oh like your user came to your website clicked mint and then saw the price in uh metamask and dropped out so I didn't have this information and it was crucial information because it was it was the exact step where my users were dropping off so that's the that's let's say the second level of difficulties when you have many chains many gas prices many RPC providers but you're still working with one front end so the same level of difficulty uh it's the level two but would be just flipped on its side so when you have one deployment on one chain but you are now getting into serious defy territory so now you have multiple front ends so I really like apps that have multiple front-ends like you know I mentioned liquidy already but like yearn and curve and a lot of apps have basically independently developed and maintained front-ends which I think is a very very important part of decentralization and being able to access these apps depending on like Geo blocking or or legal restrictions in some countries for example if an us-based developer is developing a front-end they're not allowed to offer it in Iran but if an Irani based developer makes a front and of course he or she is allowed completely to do it so this is a very good very good way to to build more resilient apps but now now your troubles start with analytics so now even etherscan can't help you because etherscan has no idea which front end the transaction came from etherscan has no idea like um how to but like Google analytics can't work in this case because uh you know you would have five instances of Google analytics all connected to custom events on a single smart contract and then you would somehow have to teach your marketing people to understand the intricacies of every single chain and every single smart contract that is deployed and one of the things that I don't have in the presentation which is also very important is that usually we have a lot of smart contracts like more complex apps can have like 10 15 20 smart contracts running uh and you know your users will maybe interact in a single transaction with three or four of them and then you will see all of this as like many interactions on etherscan like a lot of transactions but at the end of the day it's just a single transaction so um yeah so these are these are some of the most uh most obvious problems with with analytics and then the worst case is I'm not gonna even explain this one it's basically the worst of Both Worlds so the worst of many chains and the worst of uh many front-ends so these are the challenges I mean the talk is called challenges but I'm not gonna just tell you the challenges and then leave uh so what are the solutions um so I am currently collaborating with a company a disclaimer that does a tool that solves this it's called polyflow um helping them out on something and this is how I actually got to the idea of of this talk uh but um how it how this this came to be so um we had this app there was a low code environment which is called dev3 we still have it uh and we had I think 300 000 events on Google analytics like people ended on our landing page tried to open an account and everything but then it converted into a very low number of actual users but what we realized through many many uh days of like looking at the data and understanding it and taking that we are blockchain developers like we can understand this data is that users who were Landing didn't even have wallets they weren't blockchain users they were like people who somehow accidentally stumbled Upon Our uh website and you know maybe they're regular developers they wanted to see how it works but they needed a wallet to open up our app and so they dropped off as soon as they understood that they need to install metamask um and so this this kind of sparked this uh idea of thinking of thinking about how how analytics can be done better so um how it's being solved it's being solved by installing a Tracker script basically in the header of an application so this tracker script uh in its most simplest form uh basically tracks all RPC events that are being triggered from the front end to the blockchain it listens to them and then stores them in a back-end database then this back end has RPC providers for many chains and queries on-chain data and there is a data engine behind it which can combine this off-chain and on-chain data into something you can you can understand so you can say okay look I have these three marketing campaigns my Twitter paid ads my LinkedIn paid ads and I don't know my organic organic growth hacking or whatever referrals and so I want to track how much they are converting and this tool can give you like um uh information how many of those people actually had wallets of those who had wallets how many of them actually connected their wallet how many of those people executed a transaction if they executed the transaction what was it which smart contract did they interact with and on what chain did they interact with this smart contract and then you can attribute stuff like okay please tell me like which campaign performs best on high net worth users or which campaign performs best on certain nft collection owners which campaign performs best on uh let's say users who are very active on chain who have more than 600 700 transactions or something like that so you can write like actionable on chain queries which are then connected with your front end which can be deployed on multiple front ends and you will exactly know from which front-end which transaction came because you are tracking it at the level of the front end not at the level of the blockchain so this this is not the only tool that does this there are a lot of tools and I've been exploring them but most of them approach it the similar way so it's you do something you catch certain events on the front end you combine all the marketing and analytics things from traditional analytics and then you combine them with all the blockchain data into something meaningful this enables you to do a blockchain based retargeting as I mentioned it didn't even suggest to get General insights in your app like oh I'm having a lot of users who are coming and using wallet connect or I'm having a lot of users who are using metamask or coinbase wallets so maybe I should or I'm having a lot of users who don't have a wallet maybe I should make a very very easy to understand guide to get them their first wallet you know so these are the type of insights that I wouldn't have before and now with these modern uh modern analytics tools these are these are some of the things I can do so I'm a bit involved in the space no not not too much but it's a very very interesting new development in blockchain which I'm very looking forward to see uh how it goes and how how marketing and analytics are going to look for web3 apps in the future I think the bear Market is the perfect market for these types of tools because it used to be in the bull you just throw money at everything and then hope something sticks Now teams are actually like they have limited budgets they need have kpis they need to hit they want to become profitable they want to acquire users at a cheaper cost so yeah um that's basically it I don't have any uh pictures or slides I I like my presentations to be like uh verbal presentations not really not really visual but uh yeah that's uh that's about it uh if there's any questions I'd be more than happy to answer them just a sec we have we have also one person here is there any future plans that you can share with us regarding development um so this is not my project um just uh advisor I'm helping them out but I think you know there are um early stage projects uh I think they're they're very heavy in development right now to be honest so uh yeah um and I think you know it's it's one project that's worth taking a look at but I don't want to be like the Shelly guy you know uh look but there are others there is uh there is like with blaze they do like um marketing attribution that is addressable they do retargeting there is uh cookie three I think they do like some cross side tracking on on blockchain wallets there is uh there's quite quite a few tools yeah so I think the market is growing very heavily uh I think the approach that the team at polyflow is taking is a very good approach but one thing that they do specifically is that it's open source so uh that's great uh but uh yeah I advise everyone to take a look at all of the solutions and then make a make an informed judgment thank you we have one more right yes so how do you uh understand if a user has a wallet uh or not if he goes into your landing page and so it could be someone that doesn't want to connect his wallet or the wallet maybe I don't know as in I mean it's a if it's a chrome add-on for example it could be disabled yeah there are several factors to it so it's it's so this has doesn't have wallet is at Best in complete data but it's better than what you could have usually so uh you can detect most wallets as extensions because they inject a Boolean into the source code it's called like for metamask the Boolean is literally called is metamask so in your SDK you check like wallet dot is metamask and then it'll tell you even if you don't connect the wallet it will tell you that a user has metamask so for example you cannot detect that a user doesn't have a wallet but you can detect that they do so you know that's that's the way to look at it like if you want to just know how many people don't have wallets that's where you're going to get a lot of false positives but if you want to have uh want to know how many people actually do have wallets that's where your like everyone that you think has a wallet actually has a wallet so that's that's one additional info that you can have but of course once they connect the wallet then it's a whole different game so I think there might be also some interesting stuff that people can do to incentivize people to connect wallets like oh connect wallet and win an nft or whatever just so you can get the data because you know even like traditional marketing you always get like these lead pop-ups so leave your email we will give you 10 off so traditional marketers are very very comfortable with this I really want some information from you so that I can retarget you in the future I can I can you know get you back on the page uh web3 marketers are still struggling with this so I think if there's any way you can get the user to give you their address that's amazing because then you can do very interesting things uh in the future when they so for example one of the cool things that you can do with these tools is if a user returns for the second time and you see that they haven't you know connected the wall or they haven't they didn't do a transaction you can like they have a pop-up is something wrong uh we notice you know you have landed the transaction please contact our customer support we'll be more than happy to help you so this is how you can like increase your retention rates reduce drop-offs and all of these things oh yeah I think we have one more who wants to help you thanks for for the presentation I like the style you know like complete focus on yourself don't don't look at the slides yeah um so I'm just curious if the solution is able to handle a situation where a user has multiple uh addresses so like for example like using the front end it is like he uses one address and like that address either through the front end or through I don't know either scan calls like if the solution is able to detect like this is no question so I'm not sure about the the others for polyflo I know that it has smart address merging so it is able to sometimes detect that the same user has multiple addresses and then it will just merge it into the single user so what it can do is if you access the same front-end and just switch wallets right it will understand that this is a single person it doesn't think it's two people but also if you so this is where it gets tricky this is now this disabled in polyflow and not sure about other tools you could also do a thing if multiple people are using your Analytics tool if they connect with one wallet here and with another wallet there you could on the back end potentially merge it they don't currently do it I think they want to do it open source because there's a big kind of worms about privacy gdpr and all of these things so I think like cookie three as far as I know they do this like cross-site tracking but then you get into this kind of gdpr compliance cookie consent territory that I think is very scary for a lot of like web uh app owners to to do so other ones yeah they do they do address merging into a single user but it's not a hundred percent success rate but I would say like success rates should be very very high because you can also do a different thing uh for example if a user is using multiple browsers but then connects with the same address through two browsers then you know that those two browsers are the same person and then you can merge to browser IDs into the same person and then if they go with this other browser to a different app and connect with a different wallet you can merge all these three things into uh this is one user and since an address is not currently considered uh personally identifiable information by the European Union uh gdpr also works you don't need special consent yeah do we have any more questions I think that's it yeah thank you for your attention and yeah thank you Miss love very much for your speech and your thorough answers
Automatic transcript — names and jargon may be misspelled.