3sd / civicrm-chatbot

A chatbot for CiviCRM
Other
6 stars 4 forks source link

Tracking user interactions for Civi Instances #3

Closed nditechteam closed 6 years ago

nditechteam commented 6 years ago

@michaelmcandrew ,

For the main branch of this extension, I want to enable analytics tracking (CCSED-24). We'll want to use Google Tag Manager ("GTM") learn user behavior in order to provide guidance for what we functionality we build, user experience we implement.

Are there existing GTM Drupal integrations? If not, we may need to paste the Google Tag ManagerCopy the code below and paste it into a high-hierarchy template, one that targets every view in Civi instances that deploy Chat Bot.

Per manual instructions:

Paste this code as high in the of the page as possible:

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-W8V7PJF');</script>
<!-- End Google Tag Manager -->

Additionally, paste this code immediately after the opening tag:

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-W8V7PJF"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
stigsfoot commented 6 years ago

Hello, @michaelmcandrew, did this ever make the cut?

michaelmcandrew commented 6 years ago

@stigsfoot - this seems like something NDI specific that shouldn't go into the core extension.

Drupal does have a GTM module https://www.drupal.org/project/google_tag.

It might provide what you need.

I have installed it on https://chatbot.demo.3sd.io and given your user admin privileges so that you can see if it will meet your needs.

You can configure it here: https://chatbot.demo.3sd.io/admin/config/system/google_tag

stigsfoot commented 6 years ago

makes sense

stigsfoot commented 6 years ago

Tried an failed at appending the container ID. But it's OK, I'll look at doing this on the Drupal level. screen shot 2018-08-06 at 5 34 48 pm

michaelmcandrew commented 6 years ago

ok - closing for now but let me know if you need a hand with this...