add analytic code