Skip to content

Commit

Permalink
🥅 Guard GA event name limits (#1286)
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong authored Aug 7, 2023
1 parent 44880b2 commit 869bb07
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/util/EventLogger.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ export function logTrackerEvent(vue, category, action, label = '', value = 1) {
// do not track
if (window.doNotTrack || navigator.doNotTrack) return;
if (vue.$gtag) {
vue.$gtag.event(action, {
event_category: category,
event_label: label && label.substring(0, 499),
vue.$gtag.event(action?.substring(0, 40), {
event_category: category?.substring(0, 100),
event_label: label?.substring(0, 100),
value,
});
}
Expand Down Expand Up @@ -88,7 +88,7 @@ export function logPurchaseFlowEvent(
currency,
items: items.map(i => ({
item_id: i.classId,
item_name: i.name,
item_name: i.name?.substring(0, 100),
item_brand: isNFTBook ? 'Book NFT' : 'Writing NFT',
currency,
price: i.price,
Expand Down Expand Up @@ -129,7 +129,7 @@ export function logPurchaseNFTBookEvent(
items: [
{
item_id: classId,
item_name: name,
item_name: name?.substring(0, 100),
item_brand: 'NFT Book',
currency,
price,
Expand Down

0 comments on commit 869bb07

Please sign in to comment.