Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion acrobat/blocks/verb-widget/verb-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,20 @@ function redDir(verb) {
window.location.href = redDirLink(verb);
}

function getSplunkEndpoint() {
let splunkEndpointOverride;

function getDefaultSplunkEndpoint() {
return (getEnv() === 'prod') ? 'https://unity.adobe.io/api/v1/log' : 'https://unity-stage.adobe.io/api/v1/log';
}

function getSplunkEndpoint() {
return splunkEndpointOverride || getDefaultSplunkEndpoint();
}

function setSplunkEndpoint(endpoint) {
splunkEndpointOverride = endpoint || getDefaultSplunkEndpoint();
}

function getDemoEndpoint() {
return (getEnv() === 'prod') ? `https://acrobat.adobe.com/${demoPath}` : `https://stage.acrobat.adobe.com/${demoPath}`;
}
Expand Down Expand Up @@ -975,6 +985,7 @@ export default async function init(element) {

const { event, data } = e.detail || {};
const canSendDataToSplunk = e.detail?.sendToSplunk ?? true;
if (e.detail && 'logEndPoint' in e.detail) setSplunkEndpoint(e.detail.logEndPoint);

if (!event) return;
const metadata = mergeData({ ...data, userAttempts });
Expand Down Expand Up @@ -1006,6 +1017,9 @@ export default async function init(element) {
chunk_uploaded: () => {
if (canSendDataToSplunk) window.analytics.sendAnalyticsToSplunk('job:chunk-uploaded', VERB, metadata, getSplunkEndpoint());
},
pageConfigUpdated: () => {
if (canSendDataToSplunk) window.analytics.sendAnalyticsToSplunk('job:pageConfigUpdated', VERB, metadata, getSplunkEndpoint());
}
};

if (analyticsMap[event]) {
Expand Down Expand Up @@ -1049,6 +1063,7 @@ export default async function init(element) {
errorData,
sendToSplunk: canSendDataToSplunk = true,
} = e.detail || {};
if (e.detail && 'logEndPoint' in e.detail) setSplunkEndpoint(e.detail.logEndPoint);
if (!errorCode) return;
handleError(e.detail, true, lanaOptions);
if (errorCode.includes('cookie_not_set')) return;
Expand Down
3 changes: 2 additions & 1 deletion acrobat/scripts/alloy/verb-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,14 @@ function eventData(metaData, { appReferrer: referrer, trackingId: tracking }) {

function createPayloadForSplunk(metaData) {
const {
verb, eventName, noOfFiles, uploadTime, type, size, count, workflowStep, uploadType, userAttempts, errorData, chunkUploadAttempt, chunkNumber, assetId, maxRetryCount
verb, eventName, noOfFiles, uploadTime, type, size, count, workflowStep, uploadType, userAttempts, errorData, chunkUploadAttempt, chunkNumber, assetId, maxRetryCount, newEndpoint
} = metaData;

return {
event: {
name: eventName,
category: "acrobat",
newEndpoint: newEndpoint,
subcategory: verb,
...(uploadTime && { uploadTime }),
...(uploadType && { uploadType })
Expand Down
Loading