I'm implementing Enhanced eCommerce for the first time. I want to use it to track content consumption. I'm trying to make this implementation step-by-step.
I've some scroll event fired on my website (scroll 25%,scroll 50%,etc...). I want to use them to trigger and feed each funnel step.
I wrote the following custom HTML tag :
ga('create', 'UA-XXXXXXX-1');
//we have already 10 custom dimensions
ga('set', 'dimension11', 'eehit');
ga('require','ec');
ga('ec:addProduct', {
'id':{{Post_id}},
'typeArticle':{{m_EC_typeArticle}},
'timeSpent':{{m_EC_timeSpent}}
});
ga('ec:setAction','checkout', {
'step':{{m_EC_is_scroll_event}}
});
//add option - checkout_option
ga('send', 'event', 'Checkout', 'Option', {
hitCallback: function() {
// advance to next page
}
});
When looking at GA debugger I have two mistake :
Waiting on require of "ec" to be fulfilled.
Ignoring create request for duplicate tracking name.
so I have two questions :
- How should I send data to a specific UA with a custom HTML tag ?
- How should I initiate the EC plugins ?
I guess I also have other mistake in my code. I'm learning so I hope that all this will make sense.