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!

TRANSCRIPTION OF THIS EPISODE OF THE PODCAST

My heart has been beating faster for years. I think of you day and night me. Don't know if I'm awake, dreaming, lying or standing? I look at your lines in love, look at your function's splendor. I never want to leave you. owns me completely now.

Welcome to the Conversion Hacking Podcast. My name is Jörg Dennis Krüger and as my program director just rightly said: 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 tweaked a few words and guess who I addressed this ode to? Of course to my secret, years of hate, then love, love-hate 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, to validate forms, I don't know. Even display entire interfaces. Without JavaScript, the Internet would simply look very different than it does. And accordingly, we should also use JavaScript for ourselves. And haha. As you can see, this episode might be a bit more technical.

Although I have to say; No, I'm actually not a coder at all, I'm not a programmer, I'm not that deep into it. But JavaScript is just so great right now, a bit like PHP in some areas. With just a little knowledge and with a bit of copy-paste and a bit of thinking, you can achieve a whole lot without being the hardcore coder. Or you can find developers relatively inexpensively who can quickly develop JavaScript to change something on the site.

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

In the past, you first had to install the template, or maybe we had to add a testing tool to the site and then only had to deliver one variant, everything a little bit of a workaround follows the next. Today we have the tag manager, we can easily configure a trigger there, just throw in the JavaScript and that's it. And what can such a JavaScript then do?

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

If we already have jQuery on the page and a lot of pages work 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 Library, which saves us a lot of work. And then we move elements, reformat texts, scale images, hide elements, show elements, maybe rebuild entire navigation, show trust elements.

Yes everything! We can influence everything, we can use JavaScript to influence CSS, content on the pages, HTML structures and, of course, even functions. And we can change things very, very quickly without having to look deeper into the template or the code. And that starts with very small things. Some time ago I had a shop operator who almost had a bit of a fight with his agency about why the teasers on the start page weren't clickable. Then it was said: "Well, that's just Shopware, that's the shopping worlds.

And with the shopping worlds, we can only make the buttons clickable, but not all the images.” But if I now have such a screen-wide teaser on the start page and have such a small button on it, but the whole teaser is not clickable, that is of course bullshit. But making 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 anything about Shopware or whatever, you simply set a corresponding trigger via JavaScript and it's done 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 that's around it and that's it, then you need the JavaScript but don't adjust it at all, in order to adapt it to the teaser, the JavaScript then fetches the links automatically.

It's not rocket science, it's just a little bit of JavaScript. And you can save a lot of money there. And above all, you can make insane money with it! Because you are simply 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 as make something clickable here, or hide an element here , is otherwise sometimes a huge effort, an agency may charge two, three, four, five hours for this, but it takes a week until they have time to implement it, then a week is lost and 500 euros gone.

And you could do it easily in JavaScript, within, let's say with quality assurance and so on, two hours and then it's much, much cheaper and the JavaScript knowledge can either be built up internally, maybe there's someone somewhere who has a little bit has any idea about it, because as I said, we don't have to be very object-oriented here, we have no idea what's going on, we just have to do very simple things that you can often simply copy together, via the tag manager a really great preview function, because I can simply set the tag in the tag manager, then go to preview in the tag manager and then see whether 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, you can do that too. Of course there are pitfalls. If there is already a lot of JavaScript in the page and the page is therefore only built up very slowly because Ajax may be in it, then the page is only loaded later, then I have to intercept that with my JavaScript accordingly. It's a bit difficult sometimes, then I need some kind of callbacks and so on, but then maybe I can change CSS. You can also achieve a lot with CSS and I write CSS once at the top of the page and it is automatically applied to all elements that later use these CSS classes or ID or I don't know 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, somehow, a bit of perseverance to set everything up properly and I need the know-how to plan such an A/B test really well. And then at the end of this planning it still has to come out that there is still enough traffic in the areas where I test and so on. So complicated, but the technology is basically the same, with the advantage that we can make these simple JavaScript changes without an extra tool, without needing cookies and so on, we just throw it out on the page, after certain criteria, for example how I can break down the days in the tag manager to the URL or whatever, and we can just get started with it. And therefore: JavaScript, somehow my big online love.

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

Well, or ask who is familiar with 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, the topic of JavaScript is always a big part of all projects. Yes, and if you're looking for someone who knows how to do it, well then you know where to find him. So many conversions, I'm looking forward to seeing examples of how you can quickly and effectively implement things 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/Termin, simply request an initial consultation. Then we talk if we have a chance to work together. I usually call back relatively quickly when there's a request and then we'll sort it out! So all the best and many conversions, and that quickly with small, cool JavaScript hacks.