Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

166
Views
Seguimiento del evento para el evento del video de Youtube usando Javascript en ActiveCampaign

Quiero activar el evento para el video de Youtube en Wordpress cuando finalice el video. Y el evento será visible en la actividad del contacto de ActiveCampaign.

Pero cuando ejecuto este código, no muestra nada en la actividad de contacto de mi ActiveCampaign.

¿Cuál es el problema con mi código? ¿O alguna sugerencia?

Gracias.

 // create a short function to fire the event tracking snippet. function VideoPlayed() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { console.log("Recorded Played Video event"); console.log(this.responseText); } else { console.log(this.responseText) } }; var actid = "ACTID"; // your ActiveCampaign id. You can get this from your AC settings var eventKey = "Event key"; // your event key, also in AC settings var event = "Played Video" // whatever event you want to track. It would be a better idea to "DRY" this up, and pass the event name as a parameter into the function, so you can track any event with one function var visit = { email: "Email" // the user's email address }; var eventString = "actid=" + actid + "&key=" + eventKey + "&event=" + event + "&visit=" + encodeURIComponent(visit) + "&eventdata" + eventData; xhttp.open("POST", "https://trackcmp.net/event", true); xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhttp.send(eventString); } var vid = document.getElementById("embed_video"); var i; for (i = 0; i < vid.length; i++) { vid[i].onended = function() { VideoPlayed(); // <-- run the function once our audio has finished playing. alert("The video has ended"); }; };

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!