html - Should I add the _TrackPageview Snippet to the tag or somewhere in the JavaScript Container that fires when a link is clicked? -


When I click on the button hosted in a lightbox, then trying to set up a virtual pageview for I am here.

I know that on the normal page, let me & lt; A & gt; The need to add the snippet to the tag, but it was thinking that the functionality is different within a JS lightbox.

Do I need to add a tube anywhere in the container or do I need & lt; A & gt; Add tags to be right?

I will add the following: I want to track clicks on the submit button on the basis of this form:

I believe that I will send the code to < Code> & lt; A & gt; tag.

But two other links are hosted on one side bar (accessible from any page) & amp; The second one which shows in the lightbox, when you click on "Send us a message,"

Please tell me that I just send everyone & lt; A & gt; Link to the snippet on the tag (because that is what I want to track is a click). Thank you very much, here's what I'll call these to & lt; A & gt; tag:

& lt; A onclick = "javascript: _gaq.push (['_ trackPageview', '/ header-thank-you /]);" href = single ???? # One ???? & Gt; Submit & lt; / A & gt;

& lt; A onclick = "javascript: _gaq.push (['_ trackPageview', '/ virtual contact /]);" target = "_ blank" & gt; & Lt; Span class = "link-text" & gt; Send us a message & lt; / Span & gt; & Lt; / A & gt;

& lt; A onclick = "javascript: _gaq.push (['_ trackPageview', '/ header-thank-you /]);" Href = one ???? # One ???? & Gt; & Lt; / A & gt; & Lt; Span class = "link-text" & gt; Submit & lt; / Span & gt; & Lt; / A & gt;

Here is an example where I think the function code can go to JS Container:

  `$ (newButtonAnchor) .click (function () {// alert ('clicked'); $ (SubmitButton). Click (); return false;}); Var newButtonSpan = document.createElement ('span'); $ (Newbutton Span) .attr ('square', 'text'); $ (NewButtonSpan) HTML ($ (submitButton) .val ()); I have all the_gaq stuff to separate tasks in all central frequencies. Recommend encoding. Otherwise, you are facing a long-term nightmare of maintenance.  

In addition: If you have the onclick parameter in your and then it does' t javascript: As is the "protocol", it is is javascript: & lt; One onclick = "_gaq.push ...

jQuery aproach is the best thing to do with my point of view:

  & lt; style & gt; .gatracker {} / * but the elements * / & lt does not do anything; / style> gt; target = "_ blank" href = "go / something / where" square = "gatracker" & gt; Lt; span class = "link-text" & gt; send us a message & lt; / span & gt; & lt; / a & gt; ga_clickTracker = function (anchor) {... some code ... _gaq.push (['_ trackPageview', $ (anchor)) .attr ('href')]); ... ... click ... onload ... // (function () {ga_clickTracker (this ); Return;; Should be correct; // Want to proceed; // A!});    

Comments

Popular posts from this blog

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -