Showing posts from March, 2022

How to get source and medium programmatically with JavaScript - just like Google Analytics

To make smart marketing decisions, you need to know what the Return On Marketing Investment (ROMI) is. When you're a webshop that does immediate transactions, it's easier to set up Google Analytics to serve you. However, if you need to understand longer customer relationships, Lifetime Values, etc, you need to get your hands on raw data. The obvious idea that comes to mind is: "I just need to get the source, medium, campaign etc. data per each visitor" and you quickly realize that Google Analytics doesn't allow you to do that. You need a custom solution. I have found two online that solve the problem This one with FirstSession and ReturningSession cookies set The Lunametrics one , which is a bit more verbose, but has a more extensive list of search engines These solutions are just fine, but, no-one's maintaining them. They're old. They don't evolve. And they don't support other paid channels than Google search. What about Bing? Facebook? Also, bot

Popular posts from this blog

Snowflake UPSERT operation (aka MERGE)