5.8K 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

GTM event

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi,

I would like trigger event via GTM when rooms are unavailable. I don't have this information in URL, only in source code. I don't know which trigger type I should used and how configuration trigger.

 

 

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Anna K
September 2016

Re: GTM event

Top Contributor
# 2
Top Contributor

Hi,

 

You are double tracking the UA-9958337-1 property, it is tracked through GTM and there is a tracking code on the pages also, you need to resolve this by removing the tracking tag from GTM or the GA tracking code from the site.

 

In order to track when there is no room available you need to push an event into the data layer in your javascript where the no rooms available message is triggered. I'm unable to test this, it may be after the line:

 

$(document).trigger('noAvailSuggestions', { suggestions: data });

 

You need to add the event like:

 

dataLayer.push({ 'event' : 'trackEvent', 'eventCategory' : 'Rooms', 'eventAction' : 'noAvail', 'eventLabel' : 'roomName' });

 

Then in GTM create an event tracking tag and trigger it on custom event "trackEvent". You'll need to set up custom variables for collecting the values from the data layer. Please check the article below that explains the process.

 

https://zadroweb.com/gtm-data-layer-event-tracking-guide/

 

Hope this helps, let me know if you have questions.


Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

View solution in original post

Marked as Best Answer.
Solution
Accepted by topic author Anna K
September 2016

Re: GTM event

Top Contributor
# 2
Top Contributor

Hi,

 

You are double tracking the UA-9958337-1 property, it is tracked through GTM and there is a tracking code on the pages also, you need to resolve this by removing the tracking tag from GTM or the GA tracking code from the site.

 

In order to track when there is no room available you need to push an event into the data layer in your javascript where the no rooms available message is triggered. I'm unable to test this, it may be after the line:

 

$(document).trigger('noAvailSuggestions', { suggestions: data });

 

You need to add the event like:

 

dataLayer.push({ 'event' : 'trackEvent', 'eventCategory' : 'Rooms', 'eventAction' : 'noAvail', 'eventLabel' : 'roomName' });

 

Then in GTM create an event tracking tag and trigger it on custom event "trackEvent". You'll need to set up custom variables for collecting the values from the data layer. Please check the article below that explains the process.

 

https://zadroweb.com/gtm-data-layer-event-tracking-guide/

 

Hope this helps, let me know if you have questions.


Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital