The ecosystem of marketing and analytics tools is growing insanely fast, and most web platforms face tons of requests from their customers to build new destinations. But adding more destinations is hard: it requires thinking about how each one needs to work, the use cases for different customers, what data needs to be collected and where it needs to be sent. As the number of destination grows, the complexity of maintenance increases as well.
Analytics.js for Platforms gives web platforms four destinations out of the box: Google Analytics, Google Adwords, Facebook Ads and Segment. The first three cover 99% of destination needs for most small businesses, while Segment gives an escape valve to another 200+ destinations for advanced customers.
If you have questions or want to talk to our partnerships team, email firstname.lastname@example.org.
To load Analytics.js for Platforms, include this snippet on your page and initialize with the customer-specific destination settings.
Initializing takes two arguments, both optional but at least one required:
writeKey— the customer’s Segment write key, found on the
Settings → API Keyspage in their Segment account. If the customer does not have a Segment write key, pass
nullor an empty string
settings— an object containing a map of destination name to settings for that destination, detailed below. destination Settings
Each destination has a set of required and optional settings that change how it functions