function replaceUrlMacros(url, macros) {
  url = replaceMacrosValues(url, macros); // match any macros from the url that was not replaced

  var remainingMacros = url.match(/[^[\]]+(?=])/g);

  if (!remainingMacros) {
    return url;
  }

  var supportedRemainingMacros = remainingMacros.filter(function (macro) {
    return supportedMacros.indexOf(macro) > -1;
  });

  if (supportedRemainingMacros.length === 0) {
    return url;
  }

  supportedRemainingMacros = supportedRemainingMacros.reduce(function (accumulator, macro) {
    accumulator[macro] = -1;
    return accumulator;
  }, {});
  return replaceMacrosValues(url, supportedRemainingMacros);
}
/**
 * Replace the macros tracking url with their value.
 * If no value is provided for a supported macro and it exists in the url,
 * it will be replaced by -1 as described by the VAST 4.1 iab specifications
 *
 * @param {String} url - Tracking url.
 * @param {Object} macros - Object of macros to be replaced in the tracking calls
 */
Replace the macros tracking url with their value.
If no value is provided for a supported macro and it exists in the url,
it will be replaced by -1 as described by the VAST 4.1 iab specifications

@param {String} url - Tracking url.
@param {Object} macros - Object of macros to be replaced in the tracking calls
Replace the macros tracking url with their value . If no value is provided for a supported macro and it exists in the url it will be replaced by - 1 as described by the VAST 4 . 1 iab specifications @param { String } url - Tracking url . @param { Object } macros - Object of macros to be replaced in the tracking calls
function replaceUrlMacros(url, macros) {
  url = replaceMacrosValues(url, macros); 
  var remainingMacros = url.match(/[^[\]]+(?=])/g);
  if (!remainingMacros) {
    return url;
  }
  var supportedRemainingMacros = remainingMacros.filter(function (macro) {
    return supportedMacros.indexOf(macro) > -1;
  });
  if (supportedRemainingMacros.length === 0) {
    return url;
  }
  supportedRemainingMacros = supportedRemainingMacros.reduce(function (accumulator, macro) {
    accumulator[macro] = -1;
    return accumulator;
  }, {});
  return replaceMacrosValues(url, supportedRemainingMacros);
}
function replaceUrlMacros ( url , macros ) { url = replaceMacrosValues ( url , macros ) ; var remainingMacros = url . match ( / [^[\]]+(?=]) / g ) ; if ( ! remainingMacros ) { return url ; } var supportedRemainingMacros = remainingMacros . filter ( function ( macro ) { return supportedMacros . indexOf ( macro ) > - 1 ; } ) ; if ( supportedRemainingMacros . length === 0 ) { return url ; } supportedRemainingMacros = supportedRemainingMacros . reduce ( function ( accumulator , macro ) { accumulator [ macro ] = - 1 ; return accumulator ; } , { } ) ; return replaceMacrosValues ( url , supportedRemainingMacros ) ; }
Replace the macros tracking url with their value.
Replace the macros tracking url with their value .
// match any macros from the url that was not replaced