You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Great library. I've been using Angulartics for some years already in combination with the GTM plugin.
I just discovered this repo as I guess I should use this from now on (from what I understand from this issue: #13). But even now I don't think I can use GTM Enhanced Ecommerce well with this package. The reason for this is that they specifically ask for a node/variable called ecommerce in the root of the pushed object. The way I go about it right now is to override the registerEventTrack method with this:
this.registerEventTrack=function(action,properties){properties=properties||{};varknownProperties=['event','category','label','noninteraction'];varunknownProperties=_.pick(angular.copy(properties),function(value,key){return!_.contains(knownProperties,key);});// merge the normal object and perhaps custom values. Afterwards, get rit of all empty valuesthat.push(_.pick(_.extend({event: properties.event||'interaction',target: properties.category,action: action||undefined,'target-properties': properties.label,'interaction-type': properties.noninteraction},unknownProperties),function(key){return!(key===null||angular.isUndefined(key));}));};
It allows me to add custom root nodes (more than just ecommerce) while keeping the original functionality from this plugin intact. It works, but it isn't handy/dry.
Is Enhanced Ecommerce support something which is ever considered? If not, I'd love to make a pr so it's supported in the provider.
The text was updated successfully, but these errors were encountered:
Actually, I've a whole setup that support a few of the Enhanced Ecommerce methods like impressions, clicks and a purchase (as that's only what we need at the moment).
One of the features is that the impressions are only triggered and pushed when they're in the viewport which I think is kind of neat.
Anyway, I have some plans of making this into a fully fully fledged plugin for Angulartics. Let me know if you're interested in this too because perhaps we can collaborate on this.
Hello,
Great library. I've been using Angulartics for some years already in combination with the GTM plugin.
I just discovered this repo as I guess I should use this from now on (from what I understand from this issue: #13). But even now I don't think I can use GTM Enhanced Ecommerce well with this package. The reason for this is that they specifically ask for a node/variable called
ecommerce
in the root of the pushed object. The way I go about it right now is to override theregisterEventTrack
method with this:It allows me to add custom root nodes (more than just
ecommerce
) while keeping the original functionality from this plugin intact. It works, but it isn't handy/dry.Is Enhanced Ecommerce support something which is ever considered? If not, I'd love to make a pr so it's supported in the provider.
The text was updated successfully, but these errors were encountered: