Every complete example in this document is available in a zip file that you can download. The zip file includes a SQL script file that creates the input tables for the examples. If you are reading this document on https://docs.teradata.com/, you can download the zip file from the attachment in the left sidebar.
Event Type Channels
This example uses models to assign attribution weights to these events and channels.
The following two model tables apply the distribution models by rows and by seconds, respectively.
Attribution FirstModelTable: model1_table
id
model
0
SEGMENT_ROWS
1
3:0.5:EXPONENTIAL:0.5,SECOND
2
4:0.3:WEIGHTED:0.4,0.3,0.2,0.1
3
3:0.2:FIRST_CLICK:NA
Attribution SecondModelTable: model2_table
id
model
0
SEGMENT_SECONDS
1
6:0.5:UNIFORM:NA
2
8:0.3:LAST_CLICK:NA
3
6:0.2:FIRST_CLICK:NA
Attribution SQL Call
SELECT * FROM ATTRIBUTION (
ON attribution_sample_table1 AS InputTable1
PARTITION BY user_id ORDER BY time_stamp
ON attribution_sample_table2 AS InputTable2
PARTITION BY user_id ORDER BY time_stamp
ON conversion_event_table AS ConversionEventTable DIMENSION
ON excluding_event_table AS ExcludedEventTable DIMENSION
ON optional_event_table AS OptionalEventTable DIMENSION
ON model1_table AS FirstModelTable DIMENSION
ON model2_table AS SecondModelTable DIMENSION
USING
EventColumn ('event')
TimeColumn ('time_stamp')
WindowSize ('rows:10&seconds:20')
) AS dt ORDER BY user_id, time_stamp;