Split comments into parts (#3082)

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
This commit is contained in:
kolchfa-aws 2023-02-28 15:18:02 -05:00 committed by GitHub
parent b015a1ece3
commit 38eb7f858a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -59,9 +59,18 @@ function sendFeedback() {
if (helpful === 'none' && comment === 'none') return;
// split the comment into 100-char parts because of GA limitation on custom dimensions
const commentLines = ["", "", "", ""];
for (let i = 0; i <= (comment.length - 1)/100; i++) {
commentLines[i] = comment.substring(i * 100, Math.min((i + 1)*100, comment.length));
}
gtag('event', 'feedback_click', {
'helpful': helpful,
'comment': comment
'comment': commentLines[0],
'comment_2': commentLines[1],
'comment_3': commentLines[2],
'comment_4': commentLines[3],
});
// show the hidden feedback text