Introduction to Segment, Analytics API and Customer Data Platform. (Demo: Segment, AWS Redshift, Redash, Segment and GTM Alternatives) (Frontend Fighters Edition)
Recommended links:
https://segment.com/ - Analytics API and Customer Data Platform
https://open.segment.com/ - Open Source Projects of Segment
https://segment.com/docs/ - Documentation of Segment
https://redash.io/ - Open Sorce Data Dashboard
https://aws.amazon.com/redshift/ - Data Warehouse Solution
https://quicksight.aws/ - Business Analytics Service
https://www.ghostery.com/ - Tracker Detector
Keywords: business agility, tag managers, data-driven
4. Business Agility: Lexically
Agile Business
Business agility is the "ability of a business system to rapidly respond
to change by adapting its initial stable configuration".
Business agility can be maintained by maintaining and adapting
goods and services to meet customer demands, adjusting to the
changes in a business environment and taking advantage of human
resources.
(Wikipedia)
BLAH
BLAH
BLAH BLAH
BLAH BLAHBLAH
BLAH
5. Business Agility: Practically
Agile Business
Customer-centric
Rapidly respond
to change
Good team behind
(satisfied employees)
Innovative
Well-planned
Well-timed
Effective at
Risk Management
6. Business Agility Data-driven Business
Collect data before you drive...
7. Data-driven Business Data-driven People
It's a way of thinking...
Intuitive
Data-driven
8. Data-driven Business Tracking
To get data, we need to track
Contact
Information
Interactions
Context
Cart
B2B B2C / RETAIL
Interactions
Contact
Information
Lead
Data
Customer
Data
Product
Personal
Email
Address
Add Item
Company
eBook
Seen
Added to
Wishlist
Share
Age
Sex
Device
Referral
IP
OS
Resolution
LocationISP
Campaign
Seen
Downloaded
Title
Lead
Level
Quotes
Last
Login
11. Track: The Challange
What's the issue?
We want to
Ghostery: cnn.com
- track many interactions
- inspect the whole journey
- inspect from different aspects
- integrate quickly and smoothly
16. <script type="text/javascript">
(function(){
// Create a queue, but don't obliterate an
existing one!
var analytics = window.analytics = win-
dow.analytics || [];
// If the real analytics.js is already on the
page return.
if (analytics.initialize) return;
// If the snippet was invoked already show
an error.
if (analytics.invoked) {
if (window.console && console.error) {
console.error('Segment snippet included
twice.');
}
return;
}
// Invoked flag, to make sure the snippet
// is never invoked twice.
analytics.invoked = true;
// A list of the methods in Analytics.js to
stub.
analytics.methods = [
'trackSubmit',
'trackClick',
'trackLink',
'trackForm',
'pageview',
'identify',
'reset',
'group',
'track',
'ready',
'alias',
'debug',
'page',
'once',
'off',
'on'
];
// Define a factory to create stubs. These
are placeholders
// for methods in Analytics.js so that you
never have to wait
// for it to load to actually record data. The
`method` is
// stored as the first argument, so we can
replay the data.
analytics.factory = function(method){
return function(){
var args = Array.prototype.slice.call(ar-
guments);
args.unshift(method);
analytics.push(args);
return analytics;
};
};
// For each of our methods, generate a
queueing stub.
for (var i = 0; i < analytics.methods.length;
i++) {
var key = analytics.methods[i];
analytics[key] = analytics.factory(key);
}
// Define a method to load Analytics.js
from our CDN,
// and that will be sure to only ever load it
once.
analytics.load = function(key){
// Create an async script element based
on your key.
var script = document.createEle-
ment('script');
script.type = 'text/javascript';
script.async = true;
script.src = ('https:' === document.loca-
tion.protocol
? 'https://' : 'http://')
+ 'cdn.segment.com/analytics.js/v1/'
+ key + '/analytics.min.js';
// Insert our script next to the first script
element.
var first = document.getElementsBy-
TagName('script')[0];
first.parentNode.insertBefore(script,
first);
};
// Add a version to keep track of what's in
the wild.
analytics.SNIPPET_VERSION = '4.0.0';
// Load Analytics.js with your key, which
will automatically
// load the tools you've enabled for your
account. Boosh!
analytics.load("YOUR_WRITE_KEY");
// Make the first page call to load the inte-
grations. If
// you'd like to manually name or tag the
page, edit or
// move this call however you'd like.
analytics.page();
})();
</script>
SOURCES
Segment
25. Segment: Mobile
Android com.segment.analytics.android:analytics
dependencies {
compile 'com.segment.analytics.android:analytics:4.+'
}
Configure Identify
// Initially when you only know the user's name
Analytics.with(context).identify(new Traits().putName("Michael Bolton"));
// Sometime later in your app when the user gives you their email
Analytics.with(context).identify(new Traits().putEmail("mbolton@initech.com"));
// Create an analytics client with the given context and Segment write key.
Analytics analytics = new Analytics.Builder(context, YOUR_WRITE_KEY)
.trackApplicationLifecycleEvents() // Enable this to record certain application
events automatically!
.recordScreenViews() // Enable this to record screen views automatically!
.build();
// Set the initialized instance as a globally accessible instance.
Analytics.setSingletonInstance(analytics);
Initialize
Analytics.with(context)
.track("Purchased Item",
new Properties().putValue("sku", "13d31").putRevenue(199.99)
);
Track