Conditional Ajax for db Structure and Tracking