a tool for shared writing and social publishing

add referrer host to tinybird conf

+12
+12
lib/tinybird.ts
··· 94 94 date_from: p.string().optional(), 95 95 date_to: p.string().optional(), 96 96 path: p.string().optional(), 97 + referrer_host: p.string().optional(), 97 98 }, 98 99 tokens: [PROD_READ_TOKEN], 99 100 nodes: [ ··· 116 117 {% if defined(path) %} 117 118 AND path = {{String(path)}} 118 119 {% end %} 120 + {% if defined(referrer_host) %} 121 + AND domain(referrer) = {{String(referrer_host)}} 122 + {% end %} 119 123 GROUP BY day 120 124 ORDER BY day ASC 121 125 `, ··· 146 150 date_from: p.string().optional(), 147 151 date_to: p.string().optional(), 148 152 path: p.string().optional(), 153 + referrer_host: p.string().optional(), 149 154 limit: p.int32().optional(10), 150 155 }, 151 156 nodes: [ ··· 169 174 {% if defined(path) %} 170 175 AND path = {{String(path)}} 171 176 {% end %} 177 + {% if defined(referrer_host) %} 178 + AND domain(referrer) = {{String(referrer_host)}} 179 + {% end %} 172 180 GROUP BY referrer_host 173 181 ORDER BY pageviews DESC 174 182 LIMIT {{Int32(limit, 10)}} ··· 199 207 domains: p.string(), 200 208 date_from: p.string().optional(), 201 209 date_to: p.string().optional(), 210 + referrer_host: p.string().optional(), 202 211 limit: p.int32().optional(10), 203 212 }, 204 213 nodes: [ ··· 216 225 {% end %} 217 226 {% if defined(date_to) %} 218 227 AND fromUnixTimestamp64Milli(timestamp) <= parseDateTimeBestEffort({{String(date_to)}}) 228 + {% end %} 229 + {% if defined(referrer_host) %} 230 + AND domain(referrer) = {{String(referrer_host)}} 219 231 {% end %} 220 232 GROUP BY path 221 233 ORDER BY pageviews DESC