Various fixes.
This commit is contained in:
parent
dd9b8b464a
commit
83ce716d94
21 changed files with 99 additions and 114 deletions
|
@ -32,7 +32,10 @@ async function countLink(remoteIp, userAgent, campaignCid, listCid, subscription
|
|||
const subscription = await subscriptions.getByCidTx(tx, contextHelpers.getAdminContext(), list.id, subscriptionCid);
|
||||
|
||||
const country = geoip.lookupCountry(remoteIp) || null;
|
||||
const device = uaParser(userAgent, { unknownUserAgentDeviceType: 'desktop', emptyUserAgentDeviceType: 'desktop' });
|
||||
const device = uaParser(userAgent, {
|
||||
unknownUserAgentDeviceType: 'desktop',
|
||||
emptyUserAgentDeviceType: 'desktop'
|
||||
});
|
||||
const now = new Date();
|
||||
|
||||
const _countLink = async (clickLinkId, incrementOnDup) => {
|
||||
|
@ -66,7 +69,6 @@ async function countLink(remoteIp, userAgent, campaignCid, listCid, subscription
|
|||
};
|
||||
|
||||
|
||||
|
||||
// Update opened and click timestamps
|
||||
const latestUpdates = {};
|
||||
|
||||
|
@ -82,7 +84,6 @@ async function countLink(remoteIp, userAgent, campaignCid, listCid, subscription
|
|||
await tx(subscriptions.getSubscriptionTableName(list.id)).update(latestUpdates).where('id', subscription.id);
|
||||
}
|
||||
|
||||
|
||||
// Update clicks
|
||||
if (linkId > LinkId.GENERAL_CLICK && !campaign.click_tracking_disabled) {
|
||||
await tx('links').increment('hits').where('id', linkId);
|
||||
|
@ -125,6 +126,8 @@ async function addOrGet(campaignId, url) {
|
|||
id: ids[0],
|
||||
cid
|
||||
};
|
||||
} else {
|
||||
return link;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue