Revert "Send subscription -> salesforce/v1 links to analytics"

This reverts commit 52c02138f9ef8141850e2f8ce16f2bab1e7463b0.

GitOrigin-RevId: 022e828a8e41cc73c4087b94d51fa75dbe6cfdb5
This commit is contained in:
Andrew Rumble
2024-10-22 17:14:51 +01:00
committed by Copybot
parent 6779c4a912
commit 860bd80036
5 changed files with 0 additions and 360 deletions
@@ -15,9 +15,6 @@ const analyticsEditingSessionsQueue = Queues.getQueue(
const analyticsUserPropertiesQueue = Queues.getQueue(
'analytics-user-properties'
)
const analyticsAccountMappingQueue = Queues.getQueue(
'analytics-account-mapping'
)
const ONE_MINUTE_MS = 60 * 1000
@@ -146,55 +143,6 @@ function setUserPropertyForSessionInBackground(session, property, value) {
})
}
/**
* Register mapping between two accounts.
*
* @param {object} payload - The event payload to send to Analytics
* @param {string} payload.source - The type of account linked from
* @param {string} payload.sourceId - The ID of the account linked from
* @param {string} payload.target - The type of account linked to
* @param {string} payload.targetId - The ID of the account linked to
* @param {Date} payload.createdAt - The date the mapping was created
* @property
*/
function registerAccountMapping({
source,
sourceEntity,
sourceEntityId,
target,
targetEntity,
targetEntityId,
createdAt,
}) {
Metrics.analyticsQueue.inc({
status: 'adding',
event_type: 'account-mapping',
})
analyticsAccountMappingQueue
.add('account-mapping', {
source,
sourceEntity,
sourceEntityId,
target,
targetEntity,
targetEntityId,
createdAt: createdAt ?? new Date(),
})
.then(() => {
Metrics.analyticsQueue.inc({
status: 'added',
event_type: 'account-mapping',
})
})
.catch(() => {
Metrics.analyticsQueue.inc({
status: 'error',
event_type: 'account-mapping',
})
})
}
function updateEditingSession(userId, projectId, countryCode, segmentation) {
if (!userId) {
return
@@ -401,6 +349,5 @@ module.exports = {
setUserPropertyForAnalyticsId,
updateEditingSession,
getIdsFromSession,
registerAccountMapping,
analyticsIdMiddleware: expressify(analyticsIdMiddleware),
}