Last active
April 3, 2017 09:32
-
-
Save sta1r/7547132 to your computer and use it in GitHub Desktop.
Add click event tracking to RoyalSlider
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).ready(function() { | |
| $('.rsArrowRight').click(function () { | |
| _gaq.push(['_trackEvent', 'RoyalSlider', 'Slider Arrow Right Click', 'Component ID: ' + $(this).closest('.slider-container').attr('id')]); | |
| }); | |
| $('.rsArrowLeft').click(function () { | |
| _gaq.push(['_trackEvent', 'RoyalSlider', 'Slider Arrow Left Click', 'Component ID: ' + $(this).closest('.slider-container').attr('id')]); | |
| }); | |
| // <t4 type="navigation" id="49"/> = 'Current Section Name' | |
| // if we could do this inline, you can substitute the content name from T4 | |
| // e.g. <a class="prev prevPage" onclick="_gaq.push(['_trackEvent', 'Micro Gallery', 'Prev page click', '<t4 type="content" name="Name" output="normal" modifiers="" />']);"></a> | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I am trying to make the RoyalSlider click events work with WP Google Analytics Events.
How can I accomplish this?
My website is at https://www.kasteelsterkenburg.nl