Home >
Tracking Campaigns >
Tutorials, Tips and Guides
How To Find Out Which Javascript Questions Are Killing Your CTR (15)
02-04-2014 07:04 PM
#1
caurmen (Administrator)
How To Find Out Which Javascript Questions Are Killing Your CTR
So you've put up a rules lander, and it's not getting good CTR.
But WHY not?
One of the problems with using landers that incorporate Javascript and user interaction is that there's a lot more that could be going on inside the lander. It's entirely possible that people love most of the lander, but one question's putting them off. Tools like CPVLab or Prosper just don't have the power to track that.
But fortunately, there is an easy way to dive in and get loads more information on just what's going on in your lander.
In this tutorial, I'll show you how to find out exactly which questions your users are or aren't clicking through.
What You'll Need
- A Web Analytics Package: CPVLab and Prosper don't have the tracking capabilities to track Javascript events, so you'll need to use a standard Web analytics package. In this example I'm going to recommend Google Analytics, because it's free and powerful. You can sign up for Google Analytics free at http://www.google.com/analytics/ . Make sure you're using Universal Analytics (the most recent version) for this tutorial.
- A landing page that uses a Javascript-based questionaire: I'll use the code from our questionaire tutorial as an example.
- Basic understanding of HTML - you'll need to edit the markup for this.
- Basic understanding of Javascript - Only if you're editing a questionaire script that isn't based on the STM tutorial above. You'll need to find functions in the code and paste in lines.
How To Do It
First up, add your Google Analytics tracking code which you'll get when you sign up for Analytics to your landing page.
This site from Google explains all the details - note that you should put the tracking code just before your </head> tag. The code loads asynchronously, so it won't slow your lander down.
Next, locate the links that show or hide each question. On each link, add an "onclick" property if it's not there already: so, for example, if your link looks like
Code:
<a href="#question2" class="question">Yes</a>
change it to
Code:
<a href="#question2" class="question" onclick="">Yes</a>
However, if the link already has an onclick like
Code:
<a href="#question2" class="question" onclick="shownextquestion()">Yes</a>
then leave it alone.
Make sure every "Yes" or "No" link has an onclick in it.
Finally, add a snippet of code inside each onclick, before any other code. The code should look like
Code:
ga('send', 'event', 'Question1', 'NO');
Replace "Question1" with the name of the question that the link's for (Question1, Question2, etc), and 'NO' with whatever the link says - usually either 'NO' or 'YES'.
So, you should end up with something like
Code:
<a href="#question2" class="question" onclick="ga('send', 'event', 'Question2', 'YES');">Yes</a>
if there wasn't an onclick in the link already, and
Code:
<a href="#question2" class="question" onclick="ga('send', 'event', 'Question2', 'YES'); shownextquestion()">Yes</a>
if there was.
Save the landing page, upload it, and you're good to go!
How to get the results
You can check if your tracking is working by going to the "Realtime" section of Google Analytics, then clicking "Events". Whilst you're watching that, open your lander up in a new tab and go through your questionaire - you should see events popping up in the Realtime view.
Once you've verified it works, you can view the clickthroughs you're getting - or not - by going to Behaviour -> Events -> Overview in the left-hand menu in Google Analytics. From there, you'll see each of your button names in the right-hand pane, under "Event Category", and you can click on them to see how many "yes" and how many "no" results you're getting.
And there you have it - full details on how many of your visitors are clicking "yes" or "no" to each question. You can then use that information to find out which questions are driving people away, which questions get the most "no" answers, and much more data to optimise your landers with.
I hope that was helpful! If you're confused, have more suggestions, or just want to say that you found this useful, do post below!
02-04-2014 07:24 PM
#2
bbrock32 (Administrator)
Good stuff Caurmen!
I can see it helping a lot on the adult questionnaire type of landers 
02-17-2014 01:52 PM
#3
andyvon (AMC Alumnus)
Good stuff! I totally missed this thread, thanks for putting it into the newsletter! 
Just to be clear, if we put the analytics code right before the </head> tag it should have absolutely no negative effect on loading times? I'm currently running a bunch of mobile stuff, so I'm always worried about adding extra code to my landers 
02-17-2014 03:03 PM
#4
caurmen (Administrator)
@andyvon - test to be sure, but the research I did says that no, it won't have any effect. Google themselves recommend sticking the code in before the </head>, and they're bloody obsessed with loading times.
My understanding is that the GA code does clever stuff to make sure it loads asynchronously.
02-23-2014 04:30 PM
#5
erikgyepes (Moderator)
Using this method (with a bit different code) from the start. Gives a lot of additional data which can help better understand the behaviour of the users. Good stuff!
03-11-2014 10:57 PM
#6
btray77 (Member)
Google tells you to use the </head> to make sure it is more acurate at tracking. HTML, JavaScript is all loaded in order top to bottom. This will ensure analytics is completly loaded before the HTML is rendered on the users device.
If your worried about speed and don't care if you miss the occasional yes/no answers then put it before the </body>.
BTW, Google Analytics is probably already cashed on your users device so they probably wont see a real load difference anyways.
03-12-2014 12:18 AM
#7
mightier (Member)

Originally Posted by
btray77
Google tells you to use the </head> to make sure it is more acurate at tracking. HTML, JavaScript is all loaded in order top to bottom. This will ensure analytics is completly loaded before the HTML is rendered on the users device.
If your worried about speed and don't care if you miss the occasional yes/no answers then put it before the </body>.
BTW, Google Analytics is probably already cashed on your users device so they probably wont see a real load difference anyways.
As far as I know, GA is a completely a-sync call and given that I doubt many affiliates are making tons of 3rd party calls, it shouldn't slow anything down.
More importantly, even if it does slow down your page's complete DOM load, it will be transparent to the user. It's not going to interfere with your images or text loading.
07-24-2014 12:28 PM
#8
dennis (Member)
Can we also see how many people have stopped after question 1 or question 2 ?
07-24-2014 03:31 PM
#9
caurmen (Administrator)
I'd usually assume that the number of people who stopped after question 2 would be equal to the number of people who clicked on question 2 minus the number who clicked on question 3. The remainder would be, by definition, people who got to question 2 and no further.
07-24-2014 05:03 PM
#10
dennis (Member)
Thanks Caurmen... And how about a simple php script that sends the data to a txt file so we don't have to hassle with GA?
07-24-2014 10:35 PM
#11
mykeyfocus (Member)

Originally Posted by
dennis
Thanks Caurmen... And how about a simple php script that sends the data to a txt file so we don't have to hassle with GA?
http://php.net/manual/en/function.file-put-contents.php
See example 1.
Everything is only a quick Google away.
07-24-2014 11:32 PM
#12
dennis (Member)
Haha, even after reading that I don't understand it...
And I don't want to either 
I'm not in the business for understanding PHP/SQL/Jquery/.NET , I'm in the "make money online" business.
I'm sure someone will create a tutorial how to implement this easily...
07-24-2014 11:56 PM
#13
mykeyfocus (Member)

Originally Posted by
dennis
I'm not in the business for understanding PHP/SQL/Jquery/.NET , I'm in the "make money online" business.
I'm sure someone will create a tutorial how to implement this easily...
Ouch.
"Codey stuff" may not seem worth understanding and too daunting to bother learning, however i firmly believe it helps you get a leg up over the competition. A random analogy that pops into my head could be that of someone working in a bakery serving customers, uninterested in learning how to actually bake the bread. If they don't learn to bake then their work prospects will only stay at their current level.
Just my 2cents not arguing. It can all be a bit alien. It's very rewarding however and enables you to tweak and create campaigns which are truly 100% what you want.
07-25-2014 12:39 AM
#14
dennis (Member)
I understand your point of view, but I still disagree in this situation.
I could better spend my time on things that are actually bringing in money then trying to learn a coding language that easily can be outsourced.
When you want to grow a business you have to let things go and you simply can't do it all yourself.
In my opinion coding is something I don't need to do myself.
There are just 24 hours in a day...
07-25-2014 11:07 AM
#15
caurmen (Administrator)
Outsourcing this shouldn't be hard - there are plenty of GA outsourcers there who can set this up very cheaply.
Home >
Tracking Campaigns >
Tutorials, Tips and Guides