# WebEasy 6 and download monitoring with Google Analytics



## Neil B (Apr 4, 2007)

I hope that someone can help me with this head-scratching problem.
I have a website that I’ve put together using Webeasy 6.
In October I added Google Analytics to each page, so that I could track visitors. This code is added to the bottom of each page and there is a little gif picture (which is invisible for some reason, but I don’t mind that).
The code for this is as follows:

<div style="position:absolute;left:1010;top:1069;width:73;height:18;">
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "XX-nnnnnnn-n";
urchinTracker();
</script>
</div>
</body>
</html>
where XX-nnnn etc is the unique code for my site/account.
All of this works fine – perfectly in fact.

Now to the problem.
What I want to do next is to track the downloads of the mp3 files.
Google Analytics suggest the following code (quote):

Google Analytics provides an easy way to track clicks on links that lead to file downloads. Because these links do not lead to a page on your site containing the tracking code, you'll need to tag the link itself with the urchinTracker JavaScript if you would like to track these downloads. This piece of JavaScript assigns a pageview to any click on a link - the pageview is attributed to the filename you specify. 
For example, to log every click on a particular link to www.example.com/files/map.pdf as a pageview for /downloads/map you would add the following attribute to the link's <a> tag: 

<a href="http://www.example.com/files/map.pdf" onClick="javascript:urchinTracker ('/downloads/map'); "> 

Important: if your pages include a call to urchinTracker(), utmLinker(), utmSetTrans(), or utmLinkPost(), your Analytics tracking code must be placed in your HTML code above any of these calls. In these cases the tracking code can be placed anywhere between the opening <body> tag and the JavaScript call. 
To verify that urchinTracker is being called correctly, you can check your Top Content report 24-48 hours after the updated tracking code has been executed. You should be able to see the assigned pagename in your report.

So I’ve added this to a button with the following code:

<a href="http://www.tonaleffects.co.uk/cafhere.mp3" onClick="javascript:urchinTracker ('/downloads/map'); ">

I’m not too sure if I have to set up a folder for /downloads/map but I suspect it is some form of pipe for GA.
Now, when I preview my page, lo and behold, my button has completely disappeared !!!
I’ve also added a second button over the top of it and grouped the 2 together, but it still doesn’t work.

However, WebEasy help screens show the following text:

*Using the Custom Script Assistant*
Use the Custom Script Assistant to create your own scripting procedures and create links that call them. You can create scripts for the Source code, Body events or Object events.
*Important!*
Do not open this dialog unless you have knowledge of HTML code and understand HTML document structure. Scripts that you write in the Custom Script Assistant may overwrite program procedures and prevent Web Easy from operating properly.
Recommendations:
 Before using the Custom Script Assistant, build your Web site and read the HTML source code. Make a list of Procedure Names used by Web Easy, in order to avoid using them in your scripts.
 *Avoid using commands beginning with <. If such commands are linked to an image, they will overwrite the image definition*.
 Check whether any effects are already applied to objects before linking them to scripts. For example, if you write a "OnMouseOver" script for a rollover image, you will overwrite the rollover effect.


Note the “avoid using any commands that begin with……….”

So, I’m stuck.
Am I missing the point somehow?
Is there a way of entering this code so it doesn’t begin with “<” ??

Such is my dilemma.

Anyway, I’d be grateful if anyone can help.
I am aware that we’re not supposed to advertise our websites in this forum so I can’t point you to my dummy page that I’ve set up, but if you have any tips I’d be really grateful.

Neil


----------



## Maui (Feb 16, 2008)

Hi, I wish I could help you, but I was needing some information that I think you could help me with. I am also using Web Easy 6 and I can't for the life of me figure out how to even view the code for my site. I want to add the Google code to my pages, and have had no luck figuring out how to do so. I am very new to the whole coding thing.

You'd be my hero if you could help me.


----------



## Neil B (Apr 4, 2007)

Well Maui,
after weeks of hoping for a solution, I was so disapponted to find that your post wasn't it! But never mind, perhaps someone will come up with an answer someday.

For your question - see here:
http://forums.avanquestusa.com/aq/showthread.php?t=5359

To view your code, the easiest thing to do is preview a page of you website then select View - Source

Neil B


----------



## Jaxo (Feb 21, 2008)

Hope I can help.

Do you have the page uploaded and online? Would be great to see the source code.


----------



## Neil B (Apr 4, 2007)

Thanks Jaxo
I've put up a page:
http://www.tonaleffects.co.uk/tonaleffects_164.htm

There are 3 download buttons on it.
The first one (Passing Pluto) has the Google Analytics code in it, but I have left out the first bit which is the "<a" bit as this makes the button disappear.

I've run a couple of downloads today but am waiting for Google Analytics to catch up with me to see if it has been successful

Hope somebody CAN help - it's driving me daft.

Neil


----------



## Neil B (Apr 4, 2007)

I've built on the above by putting the full code in for the second button - Observing Mars.
You'll notice that the button has completely disappeared!

Oh the frustration!


----------



## Jaxo (Feb 21, 2008)

Compare first what I have, then yours below that.

*Working: (In Firefox at least)*
<div style="position: absolute; left: 301px; top: 270px; width: 88px; height: 20px;">
<a href="nbcw_passing_pluto.mp3" target="_parent" onclick="javascript:urchinTracker ('/downloads/map');"></a>
<img src="tonaleffects003007.gif" title="" alt="tonaleffects003007.gif">

---------------- Current:
<div style="position: absolute; left: 301px; top: 270px; width: 88px; height: 20px;">
<a href="nbcw_passing_pluto.mp3" target="_parent">
<img src="tonaleffects003007.gif" title="" alt="tonaleffects003007.gif" href="http://www.tonaleffects.co.uk/NBCW_Passing_Pluto.mp3" onclick="javascript:urchinTracker ('/downloads/map'); " align="top" border="0" hspace="0" vspace="0"></a>
</div>

That was a weird one above. Perhaps you were hiding the urchin tracker in the image for right now? Anyways it seems to work. Below is the Observing mars.

*Working: (In Firefox at least)*
<div style="position: absolute; left: 542px; top: 270px; width: 88px; height: 20px;">
<a href="http://www.tonaleffects.co.uk/NBCW_Observing_Mars.mp3" onclick="javascript:urchinTracker ('/downloads/map'); ">_<img src="tonaleffects003007.gif" title="" alt="tonaleffects003007.gif">_ *<-- image now*
</a></div>
--------------------Current:

<div style="position: absolute; left: 542px; top: 270px; width: 88px; height: 20px;">
<a href="http://www.tonaleffects.co.uk/NBCW_Observing_Mars.mp3" onclick="javascript:urchinTracker ('/downloads/map'); "></a></div> *<--- no image referenced.*
---

They both seem to be working now. I guess it's whether or not Google is tracking it. Let me know if it works. I used firebug for this which allows me to edit source code right in Firefox, very nice for troubleshooting.

Hope this helps!


----------



## Neil B (Apr 4, 2007)

Thanks very much Jaxo
I have absolutely no idea what any of the code means but I'll certainly give it a go.
Webeasy is strange in that you have to put the code in as I described in my opening post, so I'm not sure how I'll change it to accept your code.
I'm really grateful for the work you've put in there.
I just followed the instructions from Google Analytics.
Interestingly, the actual analytics urchin code makes the gif for the tracker disappear so I have to assume it's something to do with the opening "<" or "< a" that is causing the problem. This of course meant that the "Mars" button disappeared using the full code, whereas the Pluto one didn't.

My downloads don't seem to have registered anyway with "Pluto" so I'll give your code a shot.

Perhaps I ought to learn a bit about HTML !?!?!?!?!

I'll let you know how things go.

Have a great day in Alburquerque area!

Neil


----------



## Jaxo (Feb 21, 2008)

I would take some time to cruse http://www.w3schools.com/ to learn more about HTML and CSS. As for getting the code into Webeasy I can't help you there since I have never used it. Is there any way you can see the source code in Webeasy?

Good luck!

I am about 4 hrs. to the south of Albq., in Deming, nm. About 30 min. from Mexico. We are having some great weather out here :grin: So I am enjoying my day.


----------



## Neil B (Apr 4, 2007)

Hi Jaxo
Actually you may have been of more help than you think.

I had a study of your reply and a bit of a look at the link you recently suggested (I have been there before but not really studied it).

In terms of webeasy, if you want to add code to an object you have to load a little box called "Custom Script Assistant". It is in here that I typed the Google Analytic code.
When I run a preview of the page, yes you can see the source in Webeasy.

So it appears that by putting all of the recommended code into the custom script assistant, I have duplicated some of the code already there on screen.

For instance the <a for anchoring was already there as was the href for reference/linking.

So what I've done is to remove all the elements that were already present (on the Pluto track only) and left in the custom script assistant just the extra bits.

I've uploaded again and basically everythign that you did in firefox appears to be there, if not in the exact same order.

I've tried a download and need to wait for google analytics to catch up with me now in about 24 hours time.

So, I've learnt a bit, you've helped a lot and we just need to see if the onclick actually pipes it to google.

I'll let you know in due course.

Ta mate

Neil


----------



## Jaxo (Feb 21, 2008)

That's great! Glad I could help.


----------



## Neil B (Apr 4, 2007)

Yes you've certainly helped and having undestood some of your replies I was able to find additional help once I saw through the fog.

I've now added what I think is the correct code for each of the live buttons (not on the dummy page) and even added a filter to pipe these downloads into a separate report.

Of course it takes Google analytics quite a few hours to play catch up so I'm just awaiting the results of my tests.

If you have time, disk space and a desire to damage your ears with rubbish music (he he) perhaps you could go to the link below and try a few downloads out, let me know which ones you tried and I can monitor that to let you know if it's all been a success.

Thank you so much again - it's taken months to get to this stage so let's hope it works.

http://www.tonaleffects.co.uk/quicktraxx_music_downloads.htm

Neil B


----------



## Neil B (Apr 4, 2007)

Thanks Jaxo
It's working perfectly.:4-clap::4-clap::4-clap:

I had it tested by friends around the world

http://www.planetz.com/forums/viewtopic.php?t=24568

Just to say you chose one of the poorer tracks on the site. :grin:
Thanks so much for all your help

Neil


----------



## Jaxo (Feb 21, 2008)

Again, glad to help. I downloaded just never had time to listen. Love music and will check out more of your music. Just a matter of time and it not being 1 in the morning when everyone else is sleeping :grin:


----------

