diff --git a/circle.yml b/circle.yml index 763373e..3d3f7ad 100644 --- a/circle.yml +++ b/circle.yml @@ -15,7 +15,7 @@ test: deployment: development: - branch: ["dev", "circleci", "test"] + branch: ["dev", "test"] commands: - ./deploy/eb-deploy.sh tc-connect2sf DEV $CIRCLE_BUILD_NUM production: diff --git a/consumer/src/services/ConsumerService.js b/consumer/src/services/ConsumerService.js index fd8fc7c..58aef45 100644 --- a/consumer/src/services/ConsumerService.js +++ b/consumer/src/services/ConsumerService.js @@ -90,12 +90,15 @@ class ConsumerService { LeadSource: leadSource, Company: company, OwnerId: config.ownerId, + TC_Handle__c: user.handle, TC_Connect_Project_Id__c: project.id, TC_Connect_Description__c: _.get(project,"description",""), TC_Connect_Project_Status__c: _.get(project,"status",""), Ref_Code__c: _.get(project, "details.utm.code",""), TC_Connect_Direct_Project_Id__c: _.get(project, "directProjectId",""), - TC_Connect_Cancel_Reason__c: _.get(project,"cancelReason","") + TC_Connect_Cancel_Reason__c: _.get(project,"cancelReason",""), + Google_Analytics_Click_ID__c: _.get(project,"details.utm.google._gclid",""), + Google_Analytics_Client_ID__c: _.get(project,"details.utm.google._gacid","") }; return SalesforceService.createObject('Lead', lead, accessToken, instanceUrl) .then((leadId) => { diff --git a/consumer/test/ConsumerService.spec.js b/consumer/test/ConsumerService.spec.js index 62efa31..3483e13 100644 --- a/consumer/test/ConsumerService.spec.js +++ b/consumer/test/ConsumerService.spec.js @@ -18,6 +18,7 @@ describe('ConsumerService', () => { firstName: 'john', lastName: 'doe', email: 'jd@example.com', + handle: 'jdoe' }; const sfAuth = { accessToken: 'fake-token', @@ -29,7 +30,11 @@ describe('ConsumerService', () => { id: 1, details: { utm: { - code: "123" + code: "123", + google: { + _gacid: "1234.5678", + _gclid: "5678.1234" + } } }, cancelReason: null, @@ -80,12 +85,15 @@ describe('ConsumerService', () => { LeadSource: 'Connect', Company: 'Unknown', OwnerId: config.ownerId, + TC_Handle__c: 'jdoe', TC_Connect_Project_Id__c: 1, Ref_Code__c: '123', TC_Connect_Project_Status__c: '', TC_Connect_Cancel_Reason__c: null, TC_Connect_Direct_Project_Id__c: '', - TC_Connect_Description__c:'' + TC_Connect_Description__c:'', + Google_Analytics_Click_ID__c:'5678.1234', + Google_Analytics_Client_ID__c:'1234.5678' }; const expectedCampaignMember = {