Extra check for valid AMD id in JS tracking code