Live Helper Chat support forum.. Forum is locked. New place for questions - Github Discussions

You are not logged in.

Announcement

#1 2014-09-24 10:03:13

Robotics445
Member
Registered: 2014-02-25
Posts: 64

Getting event tracking + pixel firing working

Getting event tracking + pixel firing to work on start chat widget and page embed codes

Hi,
I'm having trouble getting the updated even tracking code to fire as per

http://livehelperchat.com/integration-w … -273a.html

I've come up with the embed codes below to fire both google event tracking and our advertising pixel when livechats started, but neither are working....am is doing something wrong?

Also, looking for advice on how I would integrate our adwords conversion tracking once any of the livechat functions were triggered?

i.e. standard adwords conversion tracking code:


=============ADWORDS CONVERSION CODE===============
<!-- Google Code for Livechat_All Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 1006923236;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "2b00CPL6uFYQ5NuR4AM";
var google_remarketing_only = false;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/1006923236/?label=2b00CPL6uFYQ5NuR4AM&amp;guid=ON&amp;script=0"/>
</div>
</noscript>


===============END OF ADWORDS CODE=====================




==============WIDGET CODE==================
<script type="text/javascript">
var LHCChatOptions = {};

LHCChatOptions.opt = {widget_width:320,widget_height:340,popup_height:520,popup_width:500,nh_title_text:'Immediate Help:',nh_sub_title_text:'Ask A Specialist Addiction Adviser:'};

LHCChatOptions.callback = {
online_chat_started_cb : function(inst) {
_gaq.push(['_trackEvent', 'LiveHelperChat', 'OnlineChatStartedWidget', 'started']);
// chat was started
},

chat_started_by_invitation_cb : function(inst) {
_gaq.push(['_trackEvent', 'LiveHelperChat', 'OnlineAutoPopLivechatSendWidget', type]);
// chat was started by invitation
},

offline_request_cb:function(inst) {
_gaq.push(['_trackEvent', 'LiveHelperChat', 'OfflineLeaveMessageSentWidget', type]);
// user has send offline request
}};


function online_chat_started_cb(inst) {
var po = document.createElement('script');
po.type = 'text/javascript'; po.async = true;
po.src = 'http://a.clickcertain.com/px/?c=1f54cd14662be38';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);}

function chat_started_by_invitation_cb(inst) {
var po = document.createElement('script');
po.type = 'text/javascript'; po.async = true;
po.src = 'http://a.clickcertain.com/px/?c=1f54cd14662be38';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);}

function offline_request_cb(inst) {
var po = document.createElement('script');
po.type = 'text/javascript'; po.async = true;
po.src = 'http://a.clickcertain.com/px/?c=1f54cd14662be38';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);}


(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
var refferer = (document.referrer) ? encodeURIComponent(document.referrer) : '';
var location  = (document.location) ? encodeURIComponent(document.location) : '';
po.src = 'http://rehabguide.co.uk/livechat/index.php/chat/getstatus/(click)/internal/(position)/bottom_right/(top)/350/(units)/pixels/(leaveamessage)/true/(department)/1?r='+refferer+'&l='+location;
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>

==============END OF WIDGET CODE==========================


=================PAGE EMBED CODE=========================

<h2>Immediate Advice? Ask The UK's Leading Addiction Rehab Specialists:</h2>
<p><!-- Place this tag where you want the Live Helper Plugin to render. --></p>
<div id="lhc_status_container_page"></div>
<p><!-- Place this tag after the Live Helper Plugin tag. --><script>// <![CDATA[
var LHCChatOptionsPage = {}; LHCChatOptionsPage.opt = {};
LHCChatOptionsPage.callback = {
online_chat_started_cb : function(inst) {
_gaq.push(['_trackEvent', 'LiveHelperChat', 'OnlineChatStartedPage', 'started']);
    // Online chat started
},   
offline_request_cb:function(inst) {
_gaq.push(['_trackEvent', 'LiveHelperChat', 'OfflineChatStartedPage', type]);
    // Offline request was send
}};
function online_chat_started_cb(inst) {
var po = document.createElement('script');
po.type = 'text/javascript'; po.async = true;
po.src = 'http://a.clickcertain.com/px/?c=1f54cd14662be38';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);}
function offline_request_cb(inst) {
var po = document.createElement('script');
po.type = 'text/javascript'; po.async = true;
po.src = 'http://a.clickcertain.com/px/?c=1f54cd14662be38';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);}
(function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = '//rehabguide.co.uk/livechat/index.php/chat/getstatusembed/(leaveamessage)/true'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })();
// ]]></script></p>

=================END OF PAGE EMBED CODE===================

Any thoughts as to what I'm doing wrong that this is not working? (i.e. no event tracking in analytics and no pixel firing in ad software)....

Also, how to embed adwords code?

Any help appreciated, many thanks again smile

Offline

#2 2014-09-24 18:27:05

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,661
Website

Re: Getting event tracking + pixel firing working

It should be something like:

Widget code

<script type="text/javascript">
var LHCChatOptions = {};
LHCChatOptions.opt = {widget_width:320,widget_height:340,popup_height:520,popup_width:500,nh_title_text:'Immediate Help:',nh_sub_title_text:'Ask A Specialist Addiction Adviser:'};
function trackClickWidget(){
var po = document.createElement('script');
po.type = 'text/javascript'; po.async = true;
po.src = 'http://a.clickcertain.com/px/?c=1f54cd14662be38';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);
};
LHCChatOptions.callback = {
online_chat_started_cb : function(inst) {
_gaq.push(['_trackEvent', 'LiveHelperChat', 'OnlineChatStartedWidget', 'started']);
trackClickWidget();
// chat was started
},
chat_started_by_invitation_cb : function(inst) {
_gaq.push(['_trackEvent', 'LiveHelperChat', 'OnlineAutoPopLivechatSendWidget', 'started_by_invitation']);
trackClickWidget();
// chat was started by invitation
},
offline_request_cb:function(inst) {
_gaq.push(['_trackEvent', 'LiveHelperChat', 'OfflineLeaveMessageSentWidget', 'offline_request_send']);
// user has send offline request
trackClickWidget();
}};

(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
var refferer = (document.referrer) ? encodeURIComponent(document.referrer) : '';
var location  = (document.location) ? encodeURIComponent(document.location) : '';
po.src = 'http://rehabguide.co.uk/livechat/index.php/chat/getstatus/(click)/internal/(position)/bottom_right/(top)/350/(units)/pixels/(leaveamessage)/true/(department)/1?r='+refferer+'&l='+location;
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>

Page embed code

[== JavaScript ==]
<script>// <![CDATA[
var LHCChatOptionsPage = {}; LHCChatOptionsPage.opt = {};

function trackOffline() {
var po = document.createElement('script');
po.type = 'text/javascript'; po.async = true;
po.src = 'http://a.clickcertain.com/px/?c=1f54cd14662be38';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);
}

LHCChatOptionsPage.callback = {
online_chat_started_cb : function(inst) {
_gaq.push(['_trackEvent', 'LiveHelperChat', 'OnlineChatStartedPage', 'started']);
    // Online chat started
 trackOffline();
},    
offline_request_cb:function(inst) {
_gaq.push(['_trackEvent', 'LiveHelperChat', 'OfflineChatStartedPage', 'offline_send']);
    // Offline request was send
trackOffline();
}};
(function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = '//rehabguide.co.uk/livechat/index.php/chat/getstatusembed/(leaveamessage)/true'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })();
// ]]></script>

Offline

#3 2014-09-25 12:45:13

Robotics445
Member
Registered: 2014-02-25
Posts: 64

Re: Getting event tracking + pixel firing working

thanks for this, will try it out

Offline

#4 2014-09-26 14:01:27

Robotics445
Member
Registered: 2014-02-25
Posts: 64

Re: Getting event tracking + pixel firing working

Hi, thanks for this, can you offer any advice on how I would integrate our adwords conversion tracking code into all of the above, e.g.

<!-- Google Code for Livechat_All Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 1006923236;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "2b00CPL6uFYQ5NuR4AM";
var google_remarketing_only = false;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/1006923236/?label=2b00CPL6uFYQ5NuR4AM&amp;guid=ON&amp;script=0"/>
</div>
</noscript>

Many thanks smile

Offline

#5 2014-09-27 05:38:28

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,661
Website

Re: Getting event tracking + pixel firing working

Update

function trackOffline() {
var po = document.createElement('script');
po.type = 'text/javascript'; po.async = true;
po.src = 'http://a.clickcertain.com/px/?c=1f54cd14662be38';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);
}

to

function trackOffline() {
var po = document.createElement('script');
po.type = 'text/javascript'; po.async = true;
po.src = '[url]http://a.clickcertain.com/px/?c=1f54cd14662be38[/url]';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);
// Has to be one line
document.write('<div style="display:inline;"><img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/1006923236/?label=2b00CPL6uFYQ5NuR4AM&amp;guid=ON&amp;script=0"/></div>');
}

Offline

#6 2014-09-27 09:47:55

Robotics445
Member
Registered: 2014-02-25
Posts: 64

Re: Getting event tracking + pixel firing working

Thankyou! I really appreciate your help with this, will try it out... smile

Offline

#7 2014-09-30 15:22:40

Robotics445
Member
Registered: 2014-02-25
Posts: 64

Re: Getting event tracking + pixel firing working

Hi remdex, ok so I'm trying to get the code without the adwords tracking to work first, i.e.

We've had offline chat forms submits from the home page, and online chats started (not invitation), but neither are tracking in event tracking google analytics...any suggestions on what might be wrong with code?

Many thanks smile

======CODE FOLLOWS=======

<script type="text/javascript">
var LHCChatOptions = {};
LHCChatOptions.opt = {widget_width:320,widget_height:340,popup_height:520,popup_width:500,nh_title_text:'Immediate Help:',nh_sub_title_text:'Ask A Specialist Addiction Adviser:'};
function trackClickWidget(){
var po = document.createElement('script');
po.type = 'text/javascript'; po.async = true;
po.src = 'http://a.clickcertain.com/px/?c=1f54cd14662be38';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);
};
LHCChatOptions.callback = {
online_chat_started_cb : function(inst) {
_gaq.push(['_trackEvent', 'LiveHelperChat', 'OnlineChatStartedWidget', 'started']);
trackClickWidget();
// chat was started
},
chat_started_by_invitation_cb : function(inst) {
_gaq.push(['_trackEvent', 'LiveHelperChat', 'OnlineAutoPopLivechatSendWidget', 'started_by_invitation']);
trackClickWidget();
// chat was started by invitation
},
offline_request_cb:function(inst) {
_gaq.push(['_trackEvent', 'LiveHelperChat', 'OfflineLeaveMessageSentWidget', 'offline_request_send']);
// user has send offline request
trackClickWidget();
}};

(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
var refferer = (document.referrer) ? encodeURIComponent(document.referrer) : '';
var location  = (document.location) ? encodeURIComponent(document.location) : '';
po.src = 'http://rehabguide.co.uk/livechat/index.php/chat/getstatus/(click)/internal/(position)/bottom_right/(top)/350/(units)/pixels/(leaveamessage)/true/(department)/1?r='+refferer+'&l='+location;
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
            <script type="text/javascript">
            var _gaq = _gaq || [];
            _gaq.push(['_setAccount', 'UA-3837767-1']);
                            _gaq.push(['_trackPageview']);
            (function () {
                var ga = document.createElement('script');
                ga.type = 'text/javascript';
                ga.async = true;
                ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';

                var s = document.getElementsByTagName('script')[0];
                s.parentNode.insertBefore(ga, s);
            })();
            //]]></script>

====END OF CODE=====

Last edited by Robotics445 (2014-09-30 15:23:00)

Offline

#8 2014-09-30 17:50:39

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,661
Website

Re: Getting event tracking + pixel firing working

Sorry, buy you will have to crack this one yourself.

Offline

#9 2014-10-28 12:34:03

Robotics445
Member
Registered: 2014-02-25
Posts: 64

Re: Getting event tracking + pixel firing working

Hi, I am still looking for help with this please, is there a donation level that would help?

Still can't get either widget code or page embed code tracking currently, i.e. nothing working - either event tracking or clickcertain tracking or adwords tracking

e.g. tried a widget chat this morning, using widget code as below, no event tracking is firing in analytics....can you help please?

<script type="text/javascript">
var LHCChatOptions = {};
LHCChatOptions.opt = {widget_width:320,widget_height:340,popup_height:520,popup_width:500,nh_title_text:'Immediate Help:',nh_sub_title_text:'Ask A Specialist Addiction Adviser:'};
function trackClickWidget(){
var po = document.createElement('script');
po.type = 'text/javascript'; po.async = true;
po.src = 'http://a.clickcertain.com/px/?c=1f54cd14662be38';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);
};
LHCChatOptions.callback = {
online_chat_started_cb : function(inst) {
_gaq.push(['_trackEvent', 'LiveHelperChat', 'OnlineChatStartedWidget', 'started']);
trackClickWidget();
// chat was started
},
chat_started_by_invitation_cb : function(inst) {
_gaq.push(['_trackEvent', 'LiveHelperChat', 'OnlineAutoPopLivechatSendWidget', 'started_by_invitation']);
trackClickWidget();
// chat was started by invitation
},
offline_request_cb:function(inst) {
_gaq.push(['_trackEvent', 'LiveHelperChat', 'OfflineLeaveMessageSentWidget', 'offline_request_send']);
// user has send offline request
trackClickWidget();
}};

(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
var refferer = (document.referrer) ? encodeURIComponent(document.referrer) : '';
var location  = (document.location) ? encodeURIComponent(document.location) : '';
po.src = 'http://rehabguide.co.uk/livechat/index.php/chat/getstatus/(click)/internal/(position)/bottom_right/(top)/350/(units)/pixels/(leaveamessage)/true/(department)/1?r='+refferer+'&l='+location;
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
         


Many thanks

Offline

Board footer