Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
99 views
in Technique[技术] by (71.8m points)

javascript - YouTube Trigger-Group not firing

to break things down imagine the following triggers:

1. YouTube-Video Trigger Firing on: Started, Finished, 10,25,50,75,90% - Loading on gtm.js

2. Custom Trigger Type: Custom event, Eventname: .* (regex), Fire trigger on: if value of first party cookie contains string "xyz"

Following tag:

  1. Custom script - just a console.log({{custom_var}});

Following custom variable:

  1. custom_var Custom JavaScript:
?function() {
  var status = {{Video Status}};
  switch (status) {
    case 'start':
      return 'play';
    case 'pause':
      return 'pause';
    case 'progress':
      return {{Video Percent}} + '%';
    case 'complete':
      return 'finish';
  }
}

Now, the required cookie with string "xyz" exists, if I set Trigger 1 on the tag, everything is working as expected - I get console.log's for all set events. If I set Trigger 2 on the tag, everything is working fine as well. But if I create a Trigger Group of Trigger 1 & Trigger 2 combined I only get the "play" logged, and then nothing else is firing. Is this wanted behaviour or could it be a bug - or do I have a error in my logic?

Thanks for your help!

question from:https://stackoverflow.com/questions/65890146/youtube-trigger-group-not-firing

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...