var payload = {
"events": {
"pageView":true
},
"page" : {},
"user": {
"loginStatus": "logN"
},
"form": {},
"SMC": {}
};
var attendee = data.attendee||{};
var sapRelationship;
switch (attendee.relationshipToSAP) {
case 'Customer':
sapRelationship = 01;
break;
case 'Prospective Customer':
sapRelationship = 02;
break;
case 'Partner':
sapRelationship = 03;
break;
case 'Prospective Partner':
sapRelationship = 04;
break;
case 'Consultant':
sapRelationship = 05;
break;
case 'Press/Analyst':
sapRelationship = 06;
break;
case 'Investor/Shareholder':
sapRelationship = 07;
break;
case 'Student':
sapRelationship = 08;
break;
case 'SAP Employee':
sapRelationship = 09;
break;
case 'Competitor':
sapRelationship = 10;
break;
}
if(data.page === 'welcome') {
payload.user.loginStatus="logY";
payload.page.url=document.location.href;
payload.page.referrer=document.referrer;
payload.page.name=document.location.pathname;
payload.page.detail="";
payload.page.section="";
payload.page.language=navigator.language;
if (window._trackData) {
console.log('Payload', payload);
window._trackData(payload);
} else {
console.warn('*** _trackData is not defined ***');
}
}
if(data.page === 'portal') {
payload.user.loginStatus="logY";
payload.page.url=document.location.href;
payload.page.referrer=document.referrer;
payload.page.name=document.location.pathname;
payload.page.detail="";
payload.page.section="";
payload.page.language=navigator.language;
if (window._trackData) {
console.log('Payload', payload);
window._trackData(payload);
} else {
console.warn('*** _trackData is not defined ***');
}
}
if(data.page === 'contactInfo') {
payload.user.loginStatus="logY";
payload.page.url=document.location.href;
payload.page.referrer=document.referrer;
payload.page.name=document.location.pathname;
payload.page.detail="";
payload.page.section="";
payload.page.language=navigator.language;
payload.events.formView=true;
payload.events.formSubmit=false;
payload.events.SMCInteraction=false;
payload.form.uniqueID=attendee.attendeeId;
payload.form.name="RF_G_2020_10_PME_EV_TechEd2020";
payload.form.referrer=document.referrer;
payload.SMC={};
if (window._trackData) {
console.log('Payload', payload);
window._trackData(payload);
} else {
console.warn('*** _trackData is not defined ***');
}
}
if(data.page === 'confirm') {
payload.user.loginStatus="logY";
payload.page.url=document.location.href;
payload.page.referrer=document.referrer;
payload.page.name=document.location.pathname;
payload.page.detail="";
payload.page.section="";
payload.page.language=navigator.language;
payload.events.formView=false;
payload.events.formSubmit=true;
payload.events.SMCInteraction=true;
payload.form.uniqueID=attendee.attendeeId;
payload.form.name="RF_G_2020_10_PME_EV_TechEd2020";
payload.form.referrer=document.referrer;
payload.form.transactionID="S-1602790796905001VwA0-"+attendee.attendeeId;
payload.form.relationship=sapRelationship;
payload.form.country=attendee.countryId.toLowerCase();
payload.SMC.interactionType="YY_ONLINE_EVENT_REG";
payload.SMC.itemsOfInterest=["No Item of Interest Value"];
payload.SMC.interactionReason="SAP_EVENT";
payload.SMC.interactionID="S-1602790796905001VwA0-"+attendee.attendeeId;
if (window._trackData) {
console.log('Payload', payload);
window._trackData(payload);
} else {
console.warn('*** _trackData is not defined ***');
}
var remainingID = ["160349575254300190m5", "16038304753970010Ind", "16037448362550018vfP"];
console.log(remainingID);
for (var i = 0; i< remainingID.length; i++) {
var payload2 = {
"SMC": {},
"page": {},
"events":{},
"form":{}
};
payload2.events.SMCInteraction=true;
payload2.events.formSubmit=false;
payload2.events.formView=false;
payload2.page.url=document.location.href,
payload2.page.referrer=document.referrer,
payload2.page.name=document.location.pathname,
payload2.page.detail="";
payload2.page.section="",
payload2.page.language=navigator.language,
payload2.form.transactionID="";
payload2.SMC.interactionType="YY_ONLINE_EVENT_REG";
payload2.SMC.itemsOfInterest=["No Item of Interest Value"];
payload2.SMC.interactionReason="SAP_EVENT";
payload2.SMC.interactionID= "S-" + remainingID[i] + "-" + attendee.attendeeId;
if (window._trackData) {
console.log('Payload: '+ "S-" + remainingID[i] + "-" + attendee.attendeeId, payload2);
window._trackData(payload2);
} else {
console.warn('*** _trackData is not defined ***');
}
payload2 = {};
}
}
// When Login occurs
window.Rainfocus.EventBus.on('rf-click-tracking-widgets-authenticate-tracked-user', function (userId) {
var payload = {
"events" : {
"pageView": true
},
"page" : {
"URL" : document.location.href,
"referrer" : document.referrer,
"name" : document.location.pathname,
"detail" : "",
"section" : "",
"language" : navigator.language
},
"user" : {
"loginStatus": "logY"
}
};
console.log('Logged in', payload);
if (window._trackData) {
window._trackData(payload);
} else {
console.warn('*** _trackData is not defined ***');
}
});
window.Rainfocus.EventBus.on('noLoggedInUserFound', function () {
var payload = {
"events" : {
"pageView": true
},
"page" : {
"URL" : document.location.href,
"referrer" : document.referrer,
"name" : document.location.pathname,
"detail" : "",
"section" : "",
"language" : navigator.language
},
"user" : {
"loginStatus": "logN"
}
};
console.log('No Logged In User', payload);
if (window._trackData) {
window._trackData(payload);
} else {
console.warn('*** _trackData is not defined ***');
}
});
function extractItemsOfInterest(sessionId) {
var externalIds = [];
// This is the result we want from the catalog page.
var resultEl = document.querySelector('[data-session-id="' + sessionId + '"]');
// This is the result we want from the session details page.
if (!resultEl)
resultEl = document.querySelector('#widget-page-session-details');
if (resultEl) {
var itemsOfInterestEls = resultEl.querySelectorAll('.attribute-ItemofInterest .attribute-values');
if (itemsOfInterestEls.length > 0) {
// We have to iterate using a `for` loop because IE doesn't support `NodeList.prototype.forEach`. Thanks IE!
for (var i = 0; i < itemsOfInterestEls.length; i++) {
var itemText = itemsOfInterestEls[i].innerHTML;
// Chained items are hard-coded to start with ", ".
if (itemText.substring(0, 2) === ', ')
itemText = itemText.substring(2);
if (itemsOfInterestMap[itemText])
externalIds.push(itemsOfInterestMap[itemText]);
}
}
}
if (externalIds.length === 0) {
externalIds.push("No Item of Interest Value");
}
return externalIds;
}
var itemsOfInterestMap = {
'SAP Manufacturing Integration and Intelligence': '01200314690800000151',
'SAP ERP HCM': '01200615320800000659',
'Public Sector': '130110653021563432906662',
'SAP Financial Statement Insights': '73554900100700001591',
'SAP Analytics Cloud': '73554900100700001571',
'SAP Predictive Analytics': '73554900100700001113',
'SAP Internet of Things': '73554900100800002247',
'SAP Marketing Cloud': '73555000100700000751',
'SAP Contact Center': '73554900100700000864',
'Engineering': '193926939960921617562539',
'SAP Cloud Identity Access Governance': '73554900100700000844',
'SAP Consumer Sales Intelligence': '73555000100700000783',
'SAP Application Interface Framework': '73554900100700000776',
'SAP Master Data Governance': '73554900100700001056',
'SAP Student Activity Hub': '73555000100700000000',
'SAP SuccessFactors Onboarding': '67838200100800006242',
'SAP Data Intelligence': '73554900100700002421',
'SAP Jam': '73554900100700001031',
'SAP Fiori': '73554900100700000977',
'High Tech': '141065692368283635970801',
'SAP Fieldglass Vendor Management System': '73554900100700000970',
'SAP Customer Engagement Center': '73555000100800001322',
'Retail': '99624789925257984685885',
'SAP Vora': '73555000100700000131',
'Automotive': '56387771929354094609172',
'SAP NetWeaver': '73554900100700001081',
'SAP Advantage Database Server': '73554900100700000769',
'Healthcare': '145882333770114278757787',
'SAP SuccessFactors Recruiting Posting': '73555000100800000318',
'SAP Cloud for Real Estate': '73554900100700001683',
'SAP Enterprise Threat Detection': '73554900100700000947',
'SAP SuccessFactors Compensation': '73555000100800000771',
'SAP Yard Logistics': '73555000100700000020',
'SAP BW/4HANA': '73554900100700001661',
'SAP Enterprise Digital Rights Management byNextLabs': '73554900100700001624',
'SAP SuccessFactors Learning': '67837800100800006334',
'SAP SuccessFactors Employee Central': '73555000100800000773',
'SAP Assurance and Compliance Software': '73554900100700000786',
'SAP RealSpend': '73554900100700001144',
'Intelligent Enterprise': 'INTELLIGENT_ENTERPRISE',
'SAP HANA Enterprise Cloud': '161153735145145802176671450589155',
'SAP Real Estate Management': '73554900100700001143',
'SAP Revenue Accounting and Reporting': '73554900100700001156',
'SAP Signature Management by DocuSign': '73554900100700001381',
'SAP S/4HANA': '73554900100700001353',
'SAP SQL Anywhere': '73554900100700001188',
'SAP Jam Communities': '73555000100800000172',
'SAP Landscape Transformation': '73554900100700001038',
'Utilities': '48826897347003784259801',
'SAP ERP': '73554900100700000951',
'SAP SuccessFactors Succession and Development': '73555000100800000776',
'SAP Business Planning and Consolidation': '73554900100700000805',
'SAP Lease Administration by Nakisa': '73554900100700001043',
'SAP Integrated Business Planning': '73554900100700001017',
'SAP Business One': '73554900100700000803',
'SAP SuccessFactors Performance and Goals': '73555000100800000774',
'SAP Time and Attendance Management byWorkForce Software': '73554900100700001426',
'SAP Process Mining by Celonis': '73554900100700001421',
'SAP Profitability and Performance Management': '73554900100700001357',
'SAP Global Trade Services': '73554900100700000993',
'SAP Sourcing and SAP Contract Lifecycle Management': '73554900100700001186',
'Oil and Gas': '156805312755941004032364',
'Ariba Network': '73554900100700000655',
'SAP Process Control': '73554900100700001119',
'SAP SuccessFactors Extended Enterprise Content Management by OpenText': '73554900100700001816',
'SAP Intelligent Asset Management': '73555000100700000851',
'SAP Global Track and Trace': '73554900100700001761',
'SAP Financial Consolidation': '73554900100700000973',
'SAP Leonardo': '73554900100700001701',
'SAP Access Violation Management by Greenlight': '73554900100700000760',
'SAP Access Control': '73554900100700000759',
'SAP SuccessFactors Workforce Analytics': '67837800100800006335',
'SAP Enterprise Asset Management': '73554900100700001771',
'SAP Cloud Appliance Library': '73554900100700000838',
'Chemicals': '41698360237425736876524',
'SAP C/4HANA': '73555000100700000911',
'SAP SuccessFactors Employee Central Payroll': '67837800100800006744',
'Banking': '131623764915182240635655',
'SAP Extended Warehouse Management': '73554900100700000963',
'Industrial Machinery and Components': '42513095034597134398119',
'SAP Product Lifecycle Costing': '73554900100700001360',
'SAP Customer Data Cloud': '73555000100700000661',
'SAP Strategy Management': '73554900100700001894',
'SAP CPQ': '73555000100800001601',
'SAP Document Center': '73555000100700000251',
'Mill Products': '31958591515119384139674',
'Mining': '140366652636409988283894',
'SAP Connected Goods': '73555000100700000271',
'SAP Portfolio and Project Management': '73554900100700001108',
'SAP Profitability and Cost Management': '73554900100700001129',
'SAP Risk Management': '73554900100700001157',
'SAP Concur': 'SAP_CONCUR',
'SAP Replication Server': '73554900100700001151',
'SAP User Experience by KNOA': '73554900100700001229',
'SAP Jam Collaboration': '67837800100800006333',
'SAP S/4HANA Finance': '67837800100800006927',
'SAP Vehicle Insights': '73555000100700000171',
'SAP Innovation Management': '73554900100700001014',
'SAP Adaptive Server Enterprise': '73554900100700000765',
'Higher Education and Research': '148449952393846517506952',
'Life Sciences': '95174915017257381839339',
'SAPUI5': '73554900100700001961',
'Sports & Entertainment': '168405230419714604047700',
'SAP Roambi': '73554900100700001611',
'SAP IT Operations Analytics': '73555000100700000033',
'SAP Cloud for Customer': '73554900100700000840',
'SAP Conversational AI': '73555000100800001301',
'Media': '46151026338704711996502',
'SAP Litmos': '73554900100700002391',
'SAP Financial Services Data Management': '73555000100700000492',
'Aerospace and Defense': '192814547175000220653543',
'SAP Master Data Services': '73555000100700000066',
'SAP Transportation Management': '73554900100700001218',
'SAP Ariba Procurement': '73554900100700001921',
'SAP Extended Enterprise Content Management by OpenText': '73554900100700000961',
'SAP Invoice Management by OpenText': '73554900100700001024',
'SAP Operational Process Intelligence': '73554900100700001092',
'SAP Edge Services': '73554900100700002011',
'SAP SuccessFactors HCM Suite': '73554900100700001452',
'SAP Business ByDesign': '73554900100700000799',
'SAP SuccessFactors Workforce Planning': '73554900100800001084',
'SAP SuccessFactors Recruiting': '67837800100800006356',
'SAP Event Ticketing': '73554900100700000000',
'Travel and Transportation': '189126846661201547308884',
'SAP Intelligent Product Design': '73555000100700000931',
'Wholesale Distribution': '26748694445508693237053',
'SAP Trade Repository Reporting by Virtusa': '73554900100700001441',
'SAP Digital Manufacturing Cloud': '73555000100800001492',
'Telecommunications': '88785088356999520628792',
'SAP Lumira': '73554900100700001049',
'Consumer Products': '22197834566642743784643',
'SAP Energy Portfolio Management': '73554900100700000932',
'SAP Landscape Management': '73554900100700001039',
'SAP Agile Data Preparation': '73555000100700000092',
'SAP Data Services': '73554900100700000901',
'SAP Financial Closing Cockpit': '73554900100700000972',
'SAP BusinessObjects Analysis': '73554900100700000813',
'SAP HANA': '73554900100700000996',
'SAP Rural Sourcing Management': '73554900100700001160',
'SAP Crystal Reports': '73554900100700000878',
'SAP PowerDesigner': '73554900100700001111',
'SAP Learning Hub': 'SAP_Learning_Hub',
'SAP Product Lifecycle Management': '73555000100700000632',
'SAP Knowledge Acceleration': '73554900100700001034',
'SAP Agricultural Contract Management': '73554900100700000771',
'SAP Predictive Maintenance and Service': '73554900100700001114',
'SAP Analytics Hub': '73554900100700001851',
'SAP Cloud Platform': '73555000100700000172',
'SAP Logistics Business Network': '73554900100700001892',
'Qualtrics': 'QUALTRICS',
'SAP Enterprise Architecture Designer': '73555000100700000443',
'Digital Business Services': 'DIGITAL_BUSINESS_SERVICES',
'SAP Ariba Supply Chain': '73554900100700001931',
'SAP S/4HANA Cloud': '73555000100700000452',
'SAP Mobile Asset Management': '73554900100700001067',
'SAP BusinessObjects Dashboards': '73554900100700000817',
'SAP S/4HANA Supply Chain': '73554900100700001821',
'SAP Intelligent Robotic Process Automation': '73554900100800002142',
'SAP Digital Boardroom': 'SAP_DIGITAL_BOARDROOM',
'SAP HANA Cloud': '73554900100800002881',
'SAP Enable Now': '73554900100700001245',
'SAP SuccessFactors HCM Core': '67837800100800006332',
'SAP Treasury and Risk Management': '73554900100700001224',
'Defense and Security': '159367983329805292011158',
'SAP Sales Cloud': '73554900100700002221',
'SAP Solution Manager': '73554900100700001184',
'SAP Cloud Platform Big Data Services': '73555000100800000691',
'SAP BusinessObjects Business Intelligence platform': '73554900100700000814',
'SAP API Management': '73554900100700000774',
'SAP Commercial Project Management': '73554900100700000848',
'Professional Services': '14945408660319805935548',
'SAP Information Steward': '73554900100700001011',
'SAP Service Cloud': '73555000100700000801',
'SAP Commerce': '73554900100700001002',
'SAP Disclosure Management': '73554900100700000915',
'SAP Customer Activity Repository': '73554900100700000880',
'SAP IQ': '73554900100700001026',
'SAP Commerce Cloud': '73554900100700002031',
'SAP Sports One': '73555000100700000019',
'Insurance': '97996813156586659752541',
'SAP Ariba Cloud Integration': '73554900100700001343',
'SAP Cloud Platform Extension Suite': 'SAP_CP_Extension_Suite',
'SAP Cloud Platform Integration Suite': '73555000100700001261',
'SAP Process Orchestration': 'SAP_Process_Orchestration',
'SAP Data Warehouse Cloud': '73555000100700001051'
};
var loggedInUserId
window.Rainfocus.EventBus.on('rf-click-tracking-widgets-authenticate-tracked-user', function (userId) {
loggedInUserId = userId
});
window.Rainfocus.EventBus.on('rf-click-tracking-widgets-session-schedule-button', function (sessionId, isAdding, sessionTimeId) {
if (!isAdding)
return
var itemsOfInterestIds = extractItemsOfInterest(sessionId)
var scheduleSessionPayload = {
SMC: {
interactionID: "S-" + sessionTimeId + "-" + loggedInUserId,
interactionType: 'YY_ONLINE_EVENT_REG',
itemsOfInterest: itemsOfInterestIds,
interactionReason: 'SAP_EVENT',
},
user: {
loginStatus: "logY"
},
events: {
SMCInteraction:true
},
page : {
"URL" : document.location.href,
"referrer" : document.referrer,
"name" : document.location.pathname,
"detail" : "",
"section" : "",
"language" : navigator.language
},
}
console.log({ scheduleSessionPayload })
if (window._trackData) {
window._trackData(scheduleSessionPayload);
}
});