Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Dante › Link Tracking
New Landing › How can we help? › Themeforest Theme Support › Dante › Link Tracking
- This topic has 15 replies, 4 voices, and was last updated 10 years by Swift Ideas – Ed.
-
Posted in: Dante
-
October 30, 2014 at 1:43 pm #124499
We currently use visistat.com to track our web statistics. I was able to put in the global page tracking javascript snippet, and that’s working perfectly. But there is an onclick event that I can add to individual links that allows me to track more specifically.
Here’s what I need to add:
ONCLICK="VSCapture('page-name-here')" TARGET="new"
So, for example I have this link:
<h1 style="text-align: center;">GIVE THANKS | Sunday, November 23 | Bridgestone Arena | <a title="Tickets" href="http://www.wochurch.org/givethanks/tickets/">Get Tickets</a></h1>
and I make it this:
<h1 style="text-align: center;">GIVE THANKS | Sunday, November 23 | Bridgestone Arena | <a ONCLICK="VSCapture('page-name-here')" TARGET="new" title="Tickets" href="http://www.wochurch.org/givethanks/tickets/">Get Tickets</a></h1>
After adding the tracking code and updating the page, it strips the onclick event from the code and leaves it like this:
<h1 style="text-align: center;">GIVE THANKS | Sunday, November 23 | Bridgestone Arena | <a title="Tickets" href="http://www.wochurch.org/givethanks/tickets/" target="new">Get Tickets</a></h1>
Can you tell me how I should be adding these to individual links?
October 30, 2014 at 2:12 pm #124513Hi,
Can you explain how/where are you inserting this
It’s inside the page content or inside any theme file?Can you also provide us admin access, might be necessary.
Please use the private reply option.-Rui
October 30, 2014 at 2:25 pm #124520This reply has been marked as private.October 30, 2014 at 3:11 pm #124538This reply has been marked as private.October 30, 2014 at 3:27 pm #124545This reply has been marked as private.October 31, 2014 at 5:32 am #124679Hi,
Please insert extra class named trackMe for tracking link. Now use this code at custom JS of theme options.<script> jQuery( document ).ready(function($) { $( "a.trackMe" ).click(function() { VSCapture($(this).text()); return true; }); }); </script>
Thanks
MohammadOctober 31, 2014 at 11:28 am #124740You guys are brilliant. Okay, so where do I pass the name variable?
`ONCLICK=”VSCapture(‘page-name-here’)” TARGET=”new”
page-name-here is user defined to help organize the links on the backend.
October 31, 2014 at 11:39 am #124744Hi,
I already passed page name through this code$(this).text()
.
Thanks
MohammadOctober 31, 2014 at 11:46 am #124746Ah, okay. I apologize for not explaining my question very well and I appreciate your patience.
page-name-here is the name of the individual href I’m tracking. So I could have 50 of these on one page, and I’ll need to be able to sort them out on the backend later by the name I give them.
October 31, 2014 at 11:48 am #124747Hi,
Please remove last one code and use this one new code:-<script> jQuery( document ).ready(function($) { $( "a.trackMe" ).click(function() { VSCapture($(this).attr('href')); return true; }); }); </script>
Thanks
MohammadOctober 31, 2014 at 11:52 am #124748href is my variable?
October 31, 2014 at 11:53 am #124749Hi,
Yes, i did as you want.
Thanks
MohammadOctober 31, 2014 at 1:09 pm #124763Okay, so I’ll put this line in the custom JS field:
<script> jQuery( document ).ready(function($) { $( "a.trackMe" ).click(function() { VSCapture($(this).attr('href')); return true; }); }); </script>
And I’ll put trackMe in the extra class field when I’m editing the content and link.
How do I change the variable for each link? For example, in the old cold:
ONCLICK=”VSCapture(‘link1’)” TARGET=”new” ONCLICK=”VSCapture(‘link2’)” TARGET=”new” ONCLICK=”VSCapture(‘link3’)” TARGET=”new”
Would render on the backend:
link1 = 31 clicks
link2 = 100 clicks
link3 = 57 clicksOctober 31, 2014 at 3:15 pm #124802Hi,
You need trackMe as extra class. I am not sure about your old code. My code will work for all links with trackMe class.
Thanks
MohammadOctober 31, 2014 at 3:40 pm #124809Unfortunately, I haven’t been able to make this work.
Here’s their guide to tracking links. This will do a better job than I have at explaining what needs to happen. I will ultimately need to be able to do both ASYNCHRONOUS EVENT TRACKING and LINK TRACKING.
http://www.visistat.com/tracking/help.php?hs=event%20and%20link%20tracking
On this last go, I put this in the custom JS:
<script> jQuery( document ).ready(function($) { $( "a.trackMe" ).click(function() { VSCapture($(this).attr('href')); return true; }); }); </script>
and in the extra class name at the bottom of the text box I put trackMe (I also tried putting it inline: …
-
Posted in: Dante
You must be logged in and have valid license to reply to this topic.