Well, not exactly banners, I just used this word as it is easier to understand in a title.

So, I have 16 different CTA "boxes" with a couple lines of persuasive copy and a CTA button. I want to test which one performs the best. I am showing the boxes randomly and counting button clicks as events in GA. However, without knowing how many times each CTA "ad" has shown, number of button clicks doesn't say much.

So, with Google Analytics, how do I trigger an even every time such CTA box is shown? It's basically a DIV that I'm in need of placing some javascript to.

2 Answers 2


I guess you will have to use Event Tracking to identify the loading of the different types of CTAs you have.

That, with perhaps the CTA box clicked configured as goals will do it.


This would be the correct answer to the question. To count impressions, we just need to place a 0 size image with onload parameter:

<img width=0 height=0 src="data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" onload="_gaq.push(['_trackEvent', 'Banner', 'Impression', 'BANNERNAME',2.00,true]);"/>

But the flaw of this method is that if the banner is on bottom of the page, the impression is still being counted, even if user didn't scroll down the page and didn't see the banner.

It would be nice if somebody could advice on how to count the impression event in analytics only when users saw the banner for sure?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.