Skip to main content

Is it the way to set event-level properties in bulk?  

const event_properties = {
    event_type: 'page view',
    loggedin:{{loggedin}},
    ehash:{{ehash}},
    post_type:{{post_type}},
    internal:{{internal}}
};

const event = {
  event_type: "view_homepage", 
  event_properties,
  //groups: { 'role': 'analytics' },
  //group_properties: { 'groupPropertyKey': 'groupPropertyValue' }
};

amplitude.track(event);

Will i be able to use the similar way to set up Configuration settings and User Properties in Google Tag? Thanks

 

I keep getting error. hope someone can help?

 


The issue has been resolved.   here’s my code.   

 


The best solution i got so far for setting event-level properties in bulk is create a function in Custom JS variable eg. amplitude_event_properties in GTM then create a Custom HTML tag.

function() {
// Add your event properties below (!! A-Z order !!)
var ep_pv = {
'content_group': {{content_group}},
'content_group2': {{content_group2}},

'ehash': {{ehash}},
'event_type': 'page view',

'internal': {{internal}},

'loggedin': {{loggedin}},

// meta properties, used for debugging and QA
'_gtm_container_version': {{Container Version}},
'_environment': {{environment}}

}

// Removing all properties set to null or 0, to get rid of the noise
var event_properties = function(v){
for(i in v){ if(v.hasOwnProperty(i)){
if((vvi] == null) || (vvi] == 'null') || (vvi] == 0)){delete vvi];}
else {vvi] = vvi];}}}
return v;}(ep_pv);
return event_properties;

}

 

<script>
amplitude.track('view_homepage', {{amplitude_event_properties}});
</script>

 


Reply