EventNative might be a Segment replacement and has two different configuration approaches depend on your desires. If you have already had configured Segment on your website and you aren't going to replace analytics.js (backend only replacement) - check Intercepting Segment Mode. If you would like to get rid of Segment completely - check Direct Pixel Tracking.
By default, Segment creates 1 table per 1 event type. For keeping these table names - configure table_name_template
like in examples below. Also, Segment creates users
table as unique records from identifies
table. For keeping it as well - create a SQL view with the following statement:
create view users asselect distinct on (email) _timestamp,anonymous_id,email,user_id,context_ip,referrer,context_user_agent,path,url,title,context_campaign_source,context_locale,context_utm_sourcefrom identifies;
EventNative javascript should be configured according to the following javascript reference and the destination should contain the following mapping configuration:
server:...destinations:destination_to_write_segment_data:type: ......data_layout:table_name_template: '{{if eq .event_type "user_identify"}}{{"identifies"}}{{else}}{{.event_type}}{{end}}'mappings:keep_unmapped: true #Use true if you would like to have Segment like DB schema + all other fields. Use false for having only Segment data.fields:- src: /src_payload/namedst: /nameaction: move- src: /src_payload/obj/context/page/titledst: /titleaction: move- src: /src_payload/obj/context/page/urldst: /urlaction: move- src: /src_payload/obj/userIddst: /user_idaction: move- src: /src_payload/obj/anonymousIddst: /anonymous_idaction: move- src: /src_payload/obj/context/library/versiondst: /context_library_versionaction: move- src: /src_payload/obj/context/page/referrerdst: /context_page_referreraction: move- src: /src_payload/obj/context/page/urldst: /context_page_urlaction: move- src: /src_payload/obj/context/page/userAgentdst: /context_user_agentaction: move- src: /src_payload/obj/context/page/referrerdst: /referreraction: move- src: /src_payload/obj/context/page/searchdst: /context_page_searchaction: move- src: /src_payload/obj/timestampdst: /timestampaction: movetype: timestamp- src: /source_ipdst: /context_ipaction: move- src: /src_payload/obj/context/library/namedst: /context_library_nameaction: move- src: /src_payload/obj/messageIddst: /idaction: move- src: /src_payload/obj/sentAtdst: /sent_ataction: movetype: timestamp- src: /src_payload/obj/context/localedst: /context_localeaction: move- src: /src_payload/obj/context/page/pathdst: /context_page_pathaction: move- src: /src_payload/obj/context/page/titledst: /context_page_titleaction: move- src: /src_payload/obj/traits/namedst: /nameaction: move- src: /src_payload/obj/traits/emaildst: /emailaction: move
EventNative javascript should be set up, tracking event calls should be placed according to your requirements and the destination should contain the following mapping configuration:
server:...destinations:destination_to_write_segment_data:type: ......data_layout:table_name_template: '{{if eq .event_type "user_identify"}}{{"identifies"}}{{else}}{{.event_type}}{{end}}'mappings:keep_unmapped: true #Use true if you would like to have Segment like DB schema + all other fields. Use false for having only Segment data.fields:- src: /eventn_ctx/utm/campaigndst: /context_campaign_sourceaction: move- src: /appdst: /appaction: move- src: /source_ipdst: /context_ipaction: move- src: /eventn_ctx/urldst: /urlaction: move- src: /eventn_ctx/user/internal_iddst: /user_idaction: move- src: /eventn_ctx/user_agentdst: /context_user_agentaction: move- src: /eventn_ctx/utc_timedst: /sent_ataction: movetype: timestamp- src: /eventn_ctx/user_languagedst: /context_localeaction: move- src: /eventn_ctx/doc_pathdst: /pathaction: move- src: /eventn_ctx/page_titledst: /titleaction: move- src: /eventn_ctx/user/anonymous_iddst: /anonymous_idaction: move- src: /eventn_ctx/refererdst: /referreraction: move- src: /eventn_ctx/user/emaildst: /emailaction: move- src: /eventn_ctx/doc_searchdst: /searchaction: move- src: /eventn_ctx/utm/sourcedst: /context_utm_sourceaction: move