-
Notifications
You must be signed in to change notification settings - Fork 144
[MAIN] [STRATCONN-2841] Added event_id in page action of Pinterest Tag #801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
95149c9
7c210fb
1127a8e
e40c395
396ddcb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,16 +62,28 @@ Pinterest.prototype.identify = function(identify) { | |
}; | ||
|
||
Pinterest.prototype.page = function(page) { | ||
var pinterestPageProps = { | ||
name: page.name() || '' | ||
}; | ||
|
||
var eventKeys = ['event_id', 'eid', 'eventID']; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we search for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay. So, do we expect customers to provide these values in properties? Is this consistent with how we can handle There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, for
varadarajan-tw marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
for (var i = 0; i < eventKeys.length; i++) { | ||
if (page.properties() && page.properties()[eventKeys[i]]) { | ||
pinterestPageProps.event_id = page.properties()[eventKeys[i]]; | ||
} | ||
} | ||
|
||
if (this.options.mapMessageIdToEventId) { | ||
pinterestPageProps.event_id = page.proxy('messageId'); | ||
} | ||
|
||
// If we have a category, the use ViewCategory. Otherwise, use a normal PageVisit. | ||
if (page.category()) { | ||
window.pintrk('track', 'ViewCategory', { | ||
category: page.category(), | ||
name: page.name() || '' | ||
}); | ||
pinterestPageProps.category = page.category(); | ||
window.pintrk('track', 'ViewCategory', pinterestPageProps); | ||
} else { | ||
window.pintrk('track', 'PageVisit', { | ||
name: page.name() || '' | ||
}); | ||
window.pintrk('track', 'PageVisit', pinterestPageProps); | ||
} | ||
}; | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.