i using segment.com .net apis pass data google analytics. after 3 4 days data has not appeared on google. nor can see data in debugger section of segment's account dashboard.
i wonder happening? there special configuration done @ google side data appear ? or there else missing.
following code used.
analytics.initialize("poam4 some-key prac",new config().setasync(false)); analytics.client.identify("billgates", new segment.model.traits() { { "name", uname }, { "email", uemail }, { "friends", counter } }); analytics.client.track("billgates", "purchased item", new segment.model.properties() { { "item", itemcounter}, { "revenue", 39.95 }, { "shipping", "2-day" } }); analytics.client.track("billgates", "logged out", new segment.model.properties() {} ); i executing them several times.... , expect appear on google analytics dashboard, bank.
any have used segment.com apis ?
if data isn't getting segment debugger, means wrong in implementation, either api keys or improperly formatted code , i'd recommend using logging that's built lib, can use so.
using segment; segment.logger.handlers += logging_handler; void logging_handler(level level, string message, dict args) { if (args != null) { foreach (string key in args.keys) { message += string.format(" {0}: {1},", "" + key, "" + args[key]); } } console.writeline(string.format("[analytics] [{0}] {1}", level, message)); } the 1 thing jumps out me you're calling new segment.model.properties() in .track() , new segment.model.traits() in .identify().
i've used new properties() in .track() , new traits() in .identify() so
analytics.client.identify("<<userid>>", new traits() { { "name", "#{ user.name }" }, { "email", "#{ user.email }" }, { "friends", 29 } }); analytics.client.track("<<userid>>", "purchased item", new properties() { { "revenue", 39.95 }, { "shipping", "2-day" } }); the code lib open-source , available on github here , segment docs pretty thorough well.
good luck!
Comments
Post a Comment