Episode 7: Small, cool JavaScript hacks!

In episode 7 of the ''Der Conversion-Hacker Podcast'', Germany's top conversion hacker Jörg Dennis Krüger explains how you can use JavaScript to make small but efficient optimizations to your online shop internally, without any in-depth knowledge of coding!


My heart has been beating faster for years. I think of you day and night. I do not know whether I am awake, dreaming, lying or standing? I look in love in your lines, look at your functions shine. I never want to leave you, you already own me completely.

Welcome to the Conversion Hacking Podcast. My name is Jörg Dennis Krüger and as my program director just said correctly: Yes, I am the conversion hacker and I started today with a little poem, in this podcast, a little interpretation of an ode to love.

I adjusted a few words and well, already guessed to whom I addressed this ode? Of course, to my secret, years-long, first hate then love, hate-love and more and more: to JavaScript.

I love JavaScript now. Of course, JavaScript used to always be like: "Oh my gosh," and for a while it was like: "Oh god, oh god, oh god, let's deactivate JavaScript in all browsers", and: "no one needs that anyway" and what do I know: "It just ruins everything." Microsoft had kind of developed their own JavaScript and la la la la, but the modern internet would be unimaginable without JavaScript.

JavaScript just works like a dream to manipulate HTML, to map functions, validate forms, whatnot. Even to display whole interfaces. Without JavaScript, the Internet would simply look very different than it does. And accordingly, we should use JavaScript for us. And haha. You realize this episode might be a bit more technical.

But I have to say: No, I'm not really a coder, I'm not a programmer, I'm not that deep into it. But JavaScript is just so great, a bit like PHP in some corners. You can achieve a lot with just a little bit of knowledge, a little bit of copy-paste and a little bit of thinking, without being a hardcore coder. Or you can also find relatively inexpensive developers who quickly develop a JavaScript to change something on the page.

And here I come to an exciting point, why I like JavaScript so much. For me, it is the workaround to all IT departments, all template developers, all store agencies and so on. And since the Google Tag Manager exists and is used so widely, my love for JavaScript has been kindled all over again, because you can just throw the JavaScript into the page so beautifully now. 

In the past, you had to build in the template first, or maybe we had to put a testing tool in the page and then just deliver a variant, all a bit of one workaround after another. Today we have the tag manager, we can simply configure a wonderful trigger, just throw in the JavaScript and that's it. And what can such a JavaScript do then?

Yes, practically everything! Because we can rebuild the page wonderfully with it.

If we already have a jQuery on the page and a lot of pages are working with jQuery somewhere anyway, so the library is already loaded, we can work much easier because we don't have to use plain JavaScript, but because we have jQuery available as a library, which takes a lot of work off our shoulders. And then we move elements, reformat texts, scale images, hide elements, show elements, maybe rebuild whole navigation, show trust elements.

Yes, everything! We can influence everything, we can influence CSS via JavaScript, content on the page HTML structures and of course even functionality. And we can change things very, very quickly without having to look deeper into the template or the code. And this starts with very small things. Some time ago, I had a store owner who almost argued with his agency about why the teasers on the start page were not clickable. Then they said: "Well, that's just Shopware, those are the shopping worlds.

And with the shopping worlds, we can only make the buttons clickable, but not the whole images." But if I have screen-wide teasers on the home page and a small button on it, but the whole teaser is not clickable, that's bullshit. But to make something clickable via JavaScript is really a matter of five minutes and then you don't need to discuss with the agency whether they really know Shopware or what, but you just put a corresponding trigger via JavaScript on it and that's it and if you put a little more work into it you can even program it so dynamically, that the JavaScript always takes the link from the button, then applies it to the image, what's around it and done, then you don't even need to adjust the JavaScript to adapt to anything again to the teaser, the JavaScript then gets the links accordingly completely automatically.

It's not rocket science, it's just a bit of JavaScript. And you can save a lot of money with it. And above all, you can earn a lot of money with it! Because you're just much faster on the road with your results. That's why JavaScript is really one of my great loves in conversion hacking, in conversion optimization more and more, because it simply works to quickly change something and such small things, like making something clickable here, or hiding an element here, is otherwise sometimes a huge effort, an agency charges maybe two, three, four, five hours for it, but needs a week until it then has time to implement it, then a week is lost and 500 euros gone.

And you could just do it in JavaScript, within, let's say with quality assurance and so on, two hours and then it's just much, much cheaper and the JavaScript knowledge you can either build up internally, maybe there's also someone somewhere who has a bit of a clue about it, because as I said, we don't have to be big object-oriented here, we don't have to be object oriented, I don't know what, but we just have to do simple things, you can often just copy them together, the tag manager has a great preview function, because I can just set the tag in the tag manager, then go to preview in the tag manager and see if it works or not.

And then I change that in the Tag Manager, click on update preview, look at it again and can debug it wonderfully until it works. It's not all that complicated. And then I'm done in no time, online. And of course, if I have a testing tool, I can use it for that and a lot of testing tools also have a "what you see is what you get" point and click or Trallala editor, then I don't even need to know JavaScript in any way , then I just click it together.

Of course, this also has its advantages and disadvantages and with some tools, some A/B testing tools, I can also click something together and then copy it into Tag Manager, which you can also do.Of course, there are pitfalls. If there is already a lot of JavaScript in the page and therefore the page is built very delayed, because there is maybe Ajax in it, then the page is loaded later, then I have to intercept that with my JavaScript accordingly. This is sometimes a bit difficult, then I need some call backs and so on, but then I can maybe change CSS. About CSS you can also achieve an insane amount and CSS I write once at the top of the page and it is automatically applied to all elements that later use these CSS classes or ID or no idea what.

Then I can't exactly hit and change the individual elements with JavaScript, but I write in at the top: "Every cell of a table, or every element with such and such a name, please apply these attributes" and that's it. I can carry quite a lot with me when it comes to design. I can't put links around it now, you have to look a little more, but as I said, the solution is usually very, very simple. Sometimes it just doesn't work, of course workarounds don't always work, it's not the 1000 percent solution that always works, but it's the 90 percent solution that gets me results very quickly.

And that's why I should always ask myself immediately when I think about any change, not: "How long does it take the agency to implement this and how complex is it and Lalala?" But the first question has to be: “Can I implement this using JavaScript? Can I throw that on the page and then when I'm done, I can try it out” If I have enough traffic, it's almost the same answer as “Can I do my A/B test?” Because it's the same, A I also have to implement /B test in JavaScript, but even if I don't have enough traffic, I can use this technology to quickly implement my results, just to try it out; Does it work? collect feedback. And if I have enough traffic, then I'll just do an A/B test, but we'll talk about it again in a separate episode, what A/B test and so on mean exactly, because A/B testing used to be that for me hot shit, today I have to say I'm a lot more skeptical because A/B tests are awesome, but it's incredibly difficult to do good A/B tests, I need real traffic for that, I need a little time.

I need, yes, somehow a bit of stamina to set up everything properly and I need the know-how to plan an A/B test really well. And then at the end of this planning, it still has to come out that there is enough traffic in the areas where I test and so on. So complicated, but the technology is actually the same, with the advantage that we can make these simple JavaScript changes, without an extra tool, without that we need cookies and so on, but we just throw it out on the page, according to certain criteria, just like I can, for example, in the tag manager accordingly decompose the days on the URL or whatever and can just get started with it. And therefore: JavaScript, somehow my great online love.

And yes, I would actually advise everyone to get to know JavaScript a bit better, even if JavaScript is not usually on Tinder, but JavaScript is very polyamorous and likes to fall in love with everyone back, you just have to fall in love with JavaScript. So start, learn a little bit and then you can achieve a lot with it.

Well, or ask someone who knows about it. In my coaching, in my conversion hacking team, I also have a JavaScript developer who looks a little deeper into such things, so that I don't have to do everything myself, of course, that's why the topic of JavaScript is always a big part of all projects. Yes and if you are looking for someone who knows how to do that, well then you know where to find him. So many conversion, I look forward to seeing examples of how you have implemented things very quickly and effectively with JavaScript.

Just send it to jdk@jdk.de. Yes, and if we want to talk more deeply about how we can implement something like this together: jdk.de/appointment, simply request an initial meeting. Then we talk if we have the chance to work together. I usually call back relatively quickly when there is a request and then we clarify it! So all the best and many conversions and that quickly through small, cool JavaScript hacks.

Write a comment