• Hi Dennis,

    First of all thanks for this great plugin.

    I have integrated the switcher into my menu and would now like to track the clicks on the different languages (with Google Analytics). To do so I need different classes for each link. Is there a way to do so?

    As I see there’s just one class specified at the moment (<a class=”current_language” …) so I can’t target the other ones separately.

    Thanks!
    Chris

    https://wordpress.org/plugins/multisite-language-switcher/

Viewing 1 replies (of 1 total)
  • Plugin Author Dennis Ploetner

    (@realloc)

    I don’t know what you need exactly but think that is something you can do with JavaScript only. Just use the title of the link like so (I assume that the parent-container of the links has the class “msls” and that the Google Analytics object is “gaq”):

    $( '.msls a' ).each( function() {
            $(this).bind( 'click', function() {
                _gaq.push( [ '_trackEvent', 'MSLS', 'click', $(this).attr( 'title' ) ] );
        } );
    } );
Viewing 1 replies (of 1 total)
  • The topic ‘Individual classes for Non-Currrent-Language Links’ is closed to new replies.