Results 1 to 1 of 1

Thread: Tracking ads in a Javascript header.

Threaded View

  1. #1
    Join Date
    Mar 2010

    Tracking ads in a Javascript header.


    I wonder if anyone can help me. I have a header I use on my site which has a Javascript code for rotating banner ads. I'd like to try to track the clickthroughs on these ads and have been looking at the methods of doing this in google analytics, but they all seem to be for single links, like this: http://www.imavex.com/tracking-click...analytics.blog

    which then don't work with the links as they are in the banner rather than more standard html links started <a href= etc. I was wondering if anyone knew how I would be able to integrate the analytics code in that link into the banner I have, or of another method I can use to track clicks on the ads.

    Thanks! Hope this makes some sense.

    This is the banner I'm using:

    <script type="text/javascript">function initArray() {
    this.length = initArray.arguments.length;
    for (var i = 0; i < this.length; i++) {
    this[i] = initArray.arguments[i];
    link = new initArray(
    image = new initArray(
    text = new initArray(
    "Meadows Toddler Tuesdays",
    "Sally Slack",
    "Low GI",
    "Talking Tots",
    "Queens Theatre",
    "Star Reach",
    "Party with Sid",
    "Meadows Kids Club"
    function getrandom(){
    var core2 = Math.floor(Math.random()*11); // amount of items in array
    function displaybanner(theNum2){
    var ranlink2 = link[theNum2];
    var ranimage2 = image[theNum2];
    var rantext2 = text[theNum2];
    </script><a href="#" target="_blank"
     id="theLink2"><img src="" alt=""
     id="theImg2" border="0"></a>
    <script type="text/javascript"> 
    setInterval("getrandom()", 22000);
    Last edited by weezypops; 08-15-2013 at 01:07 PM. Reason: cat stood on keyboard!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center