Add data-track to links in menu

So there’s actually a filter for this, provided your theme doesn’t use its own menu walker class:

function add_data_track_attribute( $atts, $item, $args ) {
    $title = apply_filters( 'the_title', $item->title, $item->ID );
    // $title = sanitize_title($title); // if you need a slug-like title
    $atts['data-track'] = 'navigation|click|'.$title;
    return $atts;
}
add_filter('nav_menu_link_attributes', 'add_data_track_attribute', 10, 3);

Note the commented-out line: I’m not sure what the data-track attribute does and, as you say, it might not allow spaces. If it doesn’t, that line will transform the title into a slug, which should be acceptable for this.

Hope this helps!

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)