Configuring experience to fire javascript when the control is served?
I need to push an event to Google Tag Manager when the control fires.
This works fine when the experience type is a custom action, where I can just create an empty variation, drop in the dataLayer push code, and treat it as the true control. But this doesn’t work for other experiences like notifications, overlays. or other types of experiences.
Can anyone help me figure out a workaround?
Background info
I need to push an event to GTM because the current Google Analytics integration doesn’t work for how we track A/B testing in GA.
We store A/B test labels in a session-scoped custom dimension, which makes it way easier to report on variations side by side in the GA interface & Google Data Studio. You’re not able to do that with the current event implementation because it requires creating segments, and you can’t report on multiple segments in the same table in Google Data Studio
-
Official comment
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-PlatformAs 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
Please sign in to leave a comment.
Comments
1 comment