Last active
March 5, 2021 15:04
-
-
Save chavesm/0876d95f38cf29b91f1562d0589e4c5f to your computer and use it in GitHub Desktop.
Use the Crisp Chat JavaScript API to send an event to GA via MonsterInsights gtag version.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
// Send an Crisp Chat event via gtag. | |
$crisp.push(["on", "chat:initiated", function() { | |
__gtagTracker('event', 'Test Event', { | |
'event_category' : 'test_event', | |
'event_action' : 'test_action', | |
'event_label' : 'This is a test event.' | |
}); | |
}]); | |
</script> | |
<!-- Add to head section of page using proper enqueue | |
techniques or a plugin like Insert Headers and Footers. --> |
Update: It seems that events starting to appear on my analytics. Il let you know the next days how its going.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have also add these events for better testing:
chat:opened
message:sent
message:received