Configuring experience to fire javascript when the control is served?

Comments

1 comment

  • Official comment
    Gidi Vigo

    Hi @benz,

    You should check out the following article about custom integrations:
    https://support.dynamicyield.com/hc/en-us/articles/360021866954-Integrate-your-Custom-Analytics-Platform

    As a quick example:

    function afterVariationSelected(tagId, tagName, experienceName, experience, variations, isNoAction) {
        var variationNames = isNoAction ? 'Control Group' : variations.map(function(variation) { return decodeURIComponent(variation.name); }).join(' , ');
    
        dataLayer.push({
          type: 'DY Campaign',
          name: tagName,
          experiment: experienceName + ' (' + variationNames + ')'
        });
    }
    Comment actions Permalink

Please sign in to leave a comment.