Show Menu
TOPICS×

Variable overrides

Variable overrides let you change Analytics values for a single hit without affecting existing variables on the page.

Workflow

  1. Create a new JavaScript object. The object name can be anything you want.
    var y = new Object();
    
    
  2. Assign valid Analytics properties to this object:
    y.eVar1 = "New value";
    y.events = "event2";
    
    
  3. Use the object as an argument within the appropriate tracking call:
    // Use the override object in a standard page view call
    s.t(y);
    
    // Use the override object in a link tracking call
    s.tl(this,'o','Example override link',y);
    
    
When a tracking call receives an object in the overrides parameter, all valid values in the override object overwrite values in the standard Analytics object. Variables already defined in your existing Analytics object are not affected.