Hello,

Thanks you for the help.

I noticed that you can select links by the value of the href and I
believe this will be best.  I will be applying the google analytics
script to over 30 websites and I really don't want to be editing each
link to add a class to them or the forms since it will take forever.


I was wondering if this was the best way:

$("a[href*=mydomain]").click(function(){
        alert("mydomain");
});

$("a[href*=mybookingengine]").click(function(){
        alert("bookingengine");
});

However, for my outgoing links I want to tag those is they are not
mydomain.com or mybookingengine.com.  How will I accomplish that?
Also, how can I verify wIith jquery that all the links within the
website linking to itself start with the www.

Thanks for your help.
Gaudicia
On Jun 29, 11:36 am, "Dan G. Switzer, II" <[EMAIL PROTECTED]>
wrote:
> Gaudicia,
>
>
>
> >I just started looking into JQuery and I have a few questions.  Mostly
> >about how to make tagging my links with google analytics tracking
> >faster.
>
> >I want to be able to track my outgoing links, which I've read is
> >possible, but I really haven't see anything about tracking third party
> >booking engines.
>
> >So basically what I want is this.
>
> >If I have links linking to my domain or an eCommerce or booking
> >engine, I don't want those links to be tagged as outgoing.  However,
> >if the link is to a booking engine/eCommerce I want them to be tagged
> >like this:
>
> ><a href="https://www.securecart.com/?store=parameters";
> >onclick="pageTracker._link(this.href); return false;">Purchase Now</a>
> >or like this <a
> >href="javascript:openWindow(pageTracker._getLinkerUrl('http://
> >bookingengine.com'))">Booking Engine</a>
>
> What you're looking to do is very easy:
>
> $("a").click(function (){
>         pageTracker._link(this.href);
>         return false;
>
> });
>
> <a href="https://www.securecart.com/?store=parameters";>Purchase Now</a>
>
> Or if you only wanted to track specific links:
>
> $("a.track").click(function (){
>         pageTracker._link(this.href);
>         return false;
>
> });
>
> <a href="https://www.securecart.com/?store=parameters";
> class="track">Purchase Now</a>
>
> Also, I'm not sure how Google Analytics link tracking works, but just
> remember that if JS is disabled, no tracking will occur.
>
> -Dan

Reply via email to