Analytics
4.9K members online now
4.9K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Firing a tag via GTM using a GA event as a trigger?

Follower ✭ ☆ ☆
# 1
Follower ✭ ☆ ☆

Hello

 

I want to know if its possible to fire a tag via GTM using a Google Analytics event as a trigger.

Or if anyone knows a way to fire a tag each time a Zopim chat starts.

 

Thanks!

2 Expert replyverified_user

Re: Firing a tag via GTM using a GA event as a trigger?

Top Contributor
# 2
Top Contributor
Hi Luan :-)
For help with GTM, their help forum can be found here:
https://productforums.google.com/forum/#!forum/tag-manager

Thanks
Bronwyn
Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Re: Firing a tag via GTM using a GA event as a trigger?

Top Contributor
# 3
Top Contributor

 

Hi Luan,

you'll need to work with the Zopim widget code to send a GTM event in the form of: (very likely)

 

// trigger when chat starts
window.dataLayer.push({"event":"zopimChat"});

Then in GTM create a trigger that catches event zopimChat and use it to fire the desired tag.

In your case, you're very likely going to need to use a callback function, like so:

$zopim.livechat.setOnChatStart(function (z){
    // trigger when chat starts
    window.dataLayer.push({"event":"zopimChat"});
});

BEar in mind the above is protocode I just typed up but you should be able to use it as-is ;-)

 

Check the Zopim widget JS API reference here:

https://api.zopim.com/files/meshim/widget/controllers/LiveChatAPI-js.html

VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

Re: Firing a tag via GTM using a GA event as a trigger?

Follower ✭ ☆ ☆
# 4
Follower ✭ ☆ ☆
Wow Julien, thank you so much!
I will be trying this and will come back to tell you how it went.
This requires the paid version of Zopim in order to work, because of the API usage? I paid for it but then when I asked them for support to track conversions they didn't helped so I went back to the free plan.

Thanks again!

Re: Firing a tag via GTM using a GA event as a trigger?

Follower ✭ ☆ ☆
# 5
Follower ✭ ☆ ☆
Julien, I believe i'm doing something wrong but I'm not sure what.
This is the website where i'm trying this:
http://todaytech2.com/tienda/

Thanks!
Take care

Re: Firing a tag via GTM using a GA event as a trigger?

Top Contributor
# 6
Top Contributor

Hi Luan,

 

you 're going to need to remove the code you added manually and edit your Wordpress plugin for Zopim, which currently generates the following output:

 

<!--Embed from Zopim Live Chat Wordpress Plugin v1.4.3-->
  <!--Start of Zopim Live Chat Script-->
  <script type="text/javascript">
  window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=z.s=
  d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set.
  _.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute('charset','utf-8');
  $.src='//v2.zopim.com/?3WYzhxGFsBWFnCTyB86Dppofidb4UpAd';z.t=+new Date;$.
  type='text/javascript';e.parentNode.insertBefore($,e)})(document,'script');
  </script>
<script>$zopim( function() {})
// INSERT CODE HERE
</script><!--End of Zopim Live Chat Script-->

So the code I mentioned would be placed (I presume) in place of the INSERT CODE HERE placeholder.

Hope that helps!

 

 

VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan