Fix share error and add analytics.