import { Analytics } from '../../../core/analytics' interface IAlbacrossData { company?: { country: string industry: string employees: { from: string to: string } financial_report: { from: string to: string } linkedin_industry_code: { category: string } name: string url: string } } declare global { interface Window { AlbacrossReveal?: IAlbacrossData } } export async function loadAlbacross(analytics: Analytics): Promise { if (!window.AlbacrossReveal) { return } const reveal = window.AlbacrossReveal.company if (!reveal || !reveal.url || analytics.group().traits()?.website) { return } await analytics.group(null, { website: reveal.url, intentSource: 'albacross', name: reveal.name || undefined, country: reveal.country || undefined, industry: reveal.linkedin_industry_code ? reveal.linkedin_industry_code.category : undefined, number_of_employees: reveal.employees ? reveal.employees.from + ' - ' + reveal.employees.to : undefined, annual_revenue: reveal.financial_report ? reveal.financial_report.from + ' - ' + reveal.financial_report.to : undefined, }) }