fivetran / dbt_iterable

Fivetran transformation models for Iterable using dbt.
https://fivetran.github.io/dbt_iterable/
Apache License 2.0
2 stars 4 forks source link

[Feature] Email Event Enrichment #37

Open rick1290 opened 9 months ago

rick1290 commented 9 months ago

Is there an existing feature request for this?

Describe the Feature

Whenever an event enters as emailOpen or emailClicked - the channel_id, channel_name, etc. all come in as NULL values making it difficult to query. This data only comes in on the emailSent event. Additionally, the transactional_data that triggered these emails is only included on the emailSent event. So I need to end up joining the message_id on each emailClick and emailOpen event to enrich the columns with the data.

Describe alternatives you've considered

Somehow it would be great to include the transaction_data from the emailSent event on triggered emails inside the emailOpen and emailClick. I don't know the best approach to this... adding a whole new column: triggered_transaction_data OR appending the transaction_data of the emailClick and emailOpen.... open to ideas.

Are you interested in contributing this feature?

Anything else?

Would love to see this added :)

fivetran-joemarkiewicz commented 8 months ago

Hi @rick1290 thank you for opening this feature request! It does sound like it would be beneficial to provide this enhancement in the package created end models so you may get the full picture of your event data. Before we dig into this further I have a few follow up questions so I may better understand the situation.

rick1290 commented 7 months ago

@fivetran-joemarkiewicz Didn't see this message. Appreciate you following up. This would be a game changer if you can implement....

  1. Correct
  2. See CSV attached
  3. I believe this would also include SMS events as well.

Really all we need is ---- when the message_id is the same - we need the transancation_data column to stay consistent with the data that triggered that event.

For instance, I need to create the below and join back up with iterable__events to get this data right now...

email_key as (

    select distinct(message_id), 
    -- JSON_EXTRACT_SCALAR(JSON_EXTRACT_SCALAR(additional_properties, "$.transactionalData"), "$.pns") as pns,
  JSON_EXTRACT_SCALAR(JSON_EXTRACT_SCALAR(transactional_data, '$'), '$.pns') AS pns
    from events
    where event_name like 'emailSend' and campaign_type like 'Triggered'
),

models_staging_iterable_stg_iterable__email_events.csv

fivetran-joemarkiewicz commented 5 months ago

Sorry for the delayed response @rick1290. The approach you shared makes sense to me and would be something we can explore adding in our next update to the Iterable package. Otherwise, if you would like to contribute a PR we would happily collaborate with you to introduce this feature! Thanks!

rick1290 commented 5 months ago

Seeing this in the next update would be awesome!!! Thanks Joe :)