// Function to load and initiate the Analytics tracker
function gaTracker(id){
  $.getScript('//www.google-analytics.com/analytics.js'); // jQuery shortcut
  window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
  ga('create', id, 'auto');
  ga('send', 'pageview');
}

// Function to track a virtual page view
function gaTrack(path, title) {
  ga('set', { page: path, title: title });
  ga('send', 'pageview');
}

// Initiate the tracker after app has loaded
gaTracker('UA-69304119-1');

// Track a virtual page
gaTrack('/', 'Accueil');
gaTrack('/index.html', 'Accueil');
gaTrack('/legroupe.html', 'Le groupe');
gaTrack('/concerts.html', 'Concerts');
gaTrack('/albums.html', 'Albums');
gaTrack('/ateliers.html', 'Ateliers');
gaTrack('/presse.html', 'Presse');
gaTrack('/contact.html', 'Contact');
gaTrack('/404.html', '404');

// Event tracking on "contact button" click
$('#contactbutton').click(function() {
  ga('send', {
    hitType: 'event',
    eventCategory: 'Contact',
    eventAction: 'click',
    eventLabel: 'contact button click'
  });
});

// Event tracking on "buy Fugue album" button click
$('#fugue-button').click(function() {
  ga('send', {
    hitType: 'event',
    eventCategory: 'Achat',
    eventAction: 'click',
    eventLabel: 'buy fugue'
  });
});

// Event tracking on "buy Prelude album" button click
$('#prelude-button').click(function() {
  ga('send', {
    hitType: 'event',
    eventCategory: 'Achat',
    eventAction: 'click',
    eventLabel: 'buy prelude'
  });
});

// Event tracking for "visit YouTube" page
$('#youtube-button').click(function() {
  ga('send', {
    hitType: 'event',
    eventCategory: 'Social',
    eventAction: 'click',
    eventLabel: 'YouTube'
  });
});

// Event tracking for "visit Facebook" page
$('#facebook-button').click(function() {
  ga('send', {
    hitType: 'event',
    eventCategory: 'Social',
    eventAction: 'click',
    eventLabel: 'Facebook'
  });
});

@@ -1011,32 +1011,47 @@
 entAction: '
+contact button 
 click',%0A
     eventLab
@@ -1030,32 +1030,32 @@
  button click',%0A
-
     eventLabel: 
@@ -1253,37 +1253,41 @@
   eventAction: '
-click
+buy fugue
 ',%0A    eventLabe
@@ -1481,37 +1481,43 @@
   eventAction: '
-click
+buy prelude
 ',%0A    eventLabe
@@ -1703,37 +1703,39 @@
   eventAction: '
-click
+YouTube
 ',%0A    eventLabe
@@ -1927,20 +1927,23 @@
 ction: '
-clic
+Faceboo
 k',%0A    

Rename event trackers