Google Tag Manager & Optimize Server-Side experiment sending variation

后端 未结 3 472
醉话见心
醉话见心 2020-12-28 10:24

I\'m using the Google Tag Manager container for managing scripts. I\'m trying to perform a server-side Optimize/Analytics experiment. I require server-side for performance r

3条回答
  •  别那么骄傲
    2020-12-28 11:15

    The root cause of this seems to be that when you setup your events with Tag Manager and use the Google Analytics Settings Variable the experiment id and variant aren't sent with the events you setup in GTM. For some reason it just doesn't pick up on the experiment you've set from the server.

    When you would setup you GTM to not work with the GA settings variable but put your settings in every GA-tag separately it does work.

    We have the same implementation of Optimize, GA and GTM on two different websites but on two different GTM containers. One is setup with a GA settings variable and one with the GA settings in every tag separately. On the one with the GA settings variable the initial setup didn't work while it did work on the other.

    Milan's answer solved it.

    With Milan's answer you wouldn't have to put your experiment id and variant in the ga('set', 'exp', ...). Putting it in the datalayer and then using them as variables should also work I expect (haven't tested it yet). Advantage is that you don't have to work with some exotic custom javascript to get that id and variant out again.

提交回复
热议问题