Google Tag Manager Custom JavaScript Parse Error -


i'm trying create custom javascript gtm variable.

but keeps telling me have parse error...

error @ line 4, character 53: parse error. ')' expected

but can't see problem. ideas whats wrong?

function() {    var clickclasses = "{{click classes}}";    if (clickclasses.includes("download-color-wheel") {      return "downloaded color wheel";    }    if (clickclasses.includes("lp-10%-coupon") {      return "claimed 10pct coupon on landing page";    }    if (clickclasses.includes("exit-popup-10%-coupon") {      return "claimed 10pct coupon on exit popup";    }    if (clickclasses.includes("video-testimonial-submitted") {      return "video testimonial submitted";    }    return "clicked";  }

closing brackets if statements missing.

updated code:

function() {   var clickclasses = "{{click classes}}";   if (clickclasses.includes("download-color-wheel")) {     return "downloaded color wheel";   }   if (clickclasses.includes("lp-10%-coupon")) {     return "claimed 10pct coupon on landing page";   }   if (clickclasses.includes("exit-popup-10%-coupon")) {     return "claimed 10pct coupon on exit popup";   }   if (clickclasses.includes("video-testimonial-submitted")) {     return "video testimonial submitted";   }   return "clicked"; } 

Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -