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. --> |
Hi Philip,
We see the code installed on your site. But we don't know how to test it.
Can you give us the steps to start a chat?
Thanks!
Mark
Hello Mark,
try on this page please: https://fordpazaropoulos.gr/test/ <https://fordpazaropoulos.gr/test/>
… On 5 Mar 2021, at 13:03, Mark Chaves ***@***.***> wrote:
@chavesm commented on this gist.
Hi Philip,
We see the code installed on your site. But we don't know how to test it.
Can you give us the steps to start a chat?
Thanks!
Mark
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <https://gist.github.com/0876d95f38cf29b91f1562d0589e4c5f#gistcomment-3654689>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ARPKW5BJUOEIU26BXROE2QLTCC3BNANCNFSM4YU6UM5A>.
I have also add these events for better testing:
chat:opened
message:sent
message:received
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
Hello Mark,
Thank for the reply, (Thomas on Ford New Motion)
I try your code but I cannot see any event from the following code.
<script> // Send an Crisp Chat event via gtag. $crisp.push(["on", "chat:initiated", function() { __gtagTracker('event', 'CrispInteractions', { 'event_category' : 'chatbox', 'event_action' : 'Chat Initiated', 'event_label' : 'Chat Initiated' }); }]); </script>
This is the help page from Crisp related to this issue. Could you please take a look?
https://help.crisp.chat/en/article/how-to-send-events-from-crisp-to-google-analytics-via-gtm-me6m5m/
Thanks in advance
Philip