CONTENT
  thinking about it, please hold on..

Back-end Segment Integration

Purpose

Yellow highlights are new updates to code.  You will need to make changes to Settings, Identity, Track, Page and Group methods:

Settings 

Integrations": {
   Totango: {
      parentId: 'cd67Mvs'
      product: {
         id: 'productA'
      }
   }
}

Identify

analytics.identify({
   userId: '019mr8mf4r',
   traits: {
      email: 'mbolton@initech.com'
	  ….
   },
   context: {
      groupId: 'MyAccount'
   },
   integrations: {
      Totango: {
         parentId: 'cd67Mvs'
		 product: {
            id: 'productA'
         }
      }
   }
});

Track

analytics.track({
   userId: '019mr8mf4r',
   event: 'Purchased an Item',
   properties: {
      category: Shopping
   },
   context: {
      groupId: 'MyAccount'
   },
   integrations: {
      Totango: {
         parentId: 'cd67Mvs'  
         product: {
            id: 'productA'
         }
      }
   }
});

Page

analytics.page({
   userId: '019mr8mf4r',
   category: 'Docs',
   properties: {
      url: 'https://segment.com/docs/libraries/node',
   },
   context: {
      groupId: 'MyAccount'
   },
   integrations: {
      Totango: {
         parentId: 'cd67Mvs'
         product: {
            id: 'productA'
         }
      }
   }
});

Group

analytics.group({
   userId: '019mr8mf4r',
   groupId: '56',
   traits: {
      name: 'Initech',
      description: 'Accounting Software'
   },
   integrations: {
      Totango: {
         parentId: 'cd67Mvs'
         product: {
            id: 'productA'
         }
      }
   }
});
Have more questions? Submit a request

Comments

Follow
Powered by Zendesk