segment-boneyard / analytics.js-integrations Goto Github PK
View Code? Open in Web Editor NEWThis project forked from taboola/analytics.js-integrations
All of the third-party analytics.js integrations.
This project forked from taboola/analytics.js-integrations
All of the third-party analytics.js integrations.
To ensure that all the webpages on your site include the remarketing tag, you should insert the remarketing tag in one place, where it would automatically update all the webpages on your site. Typically you would do this within your webpage template.
Forward this email along with the link to the setup guide in the Help Center to your webmaster or whoever will be adding the tag to your website.
Tag Assistant Chrome Extension Download this tool to verify that you've installed the remarketing tag correctly. Once installed, you can just navigate to any page of your website to see which tags are on the page. Tag assistant will also tell you if there are errors to the tag and offer suggestions on how to fix it. For more information, reference this Help Center article on Tag Assistant.
Tag Validation in AdWords allows you to see whether your remarketing tag is properly firing, provides useful statistics on your remarketing tag and in the event of a problem, shows you common solutions to help troubleshoot. For more information, reference this Help Center article on Tag Validation.
Your Remarketing Tag
<!-- Google Code for Remarketing Tag -->
<!--------------------------------------------------
Remarketing tags may not be associated with personally identifiable information or placed on pages related to sensitive categories. See more information and instructions on how to setup the tag on: http://google.com/ads/remarketingsetup
--------------------------------------------------->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 1012091361;
var google_custom_params = window.google_tag_params;
var google_remarketing_only = true;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/1012091361/?value=0&guid=ON&script=0"/>
</div>
</noscript>
We're seeing an issue where the Intercom user (set via identify
) gets disassociated from a company/group (set via group
) but only in some cases, it's a race condition.
Intercom has this concept of boot
and update
. What I think is happening is the update:group
call is getting processed on our servers before the boot:identify
call. And I think boot
is probably setup on Intercom's side to wipe other traits, so the company
trait of the user is wiped to nothing.
So to fix it, we'd need to make sure that we cache the group
like cache the user
in some integrations, and the Intercom.prototype.identify
should check the cached object to see if there are company traits to carry over.
Does that make sense @realyze?
From a user:
So for some reason our group call is behaving super inconsistently with Intercom. Expected behavior there is that a .group() call after an .identify() call will 'group' the identified user in the group (aka company) in Intercom.
This doesn't happen consistently. The only thing I can see going wrong is that the group calls seem to be consistently processed before the identify calls (http://cl.ly/image/211d1n2n0L1t) however the raw data shows that it's correct (http://cl.ly/image/0q1d0b300M1m), ie. the userId is set correctly (which is the only thing I can think that could fuck it up).
segmentio/analytics.js-integrations#31 marked as passing, but the tests failed
it turns out they had one of those <link rel="canonical" href="http://example.com" />
and that was stripping the utm parameters from the url that gets sent to GA universal
https://github.com/segmentio/analytics.js-integrations/blob/master/lib/google-analytics.js#L3
https://github.com/segmentio/analytics.js-integrations/blob/master/lib/google-analytics.js#L145
we were thinking the solution is to grab utm codes and reattach them to the canonical-ized url?
for on identify
calls:
http://www.curebit.com/docs/affiliate/registration
i think we can put the iframe
properties as settings
because of:
https://github.com/segmentio/analytics.js-integrations/blob/master/lib/quantcast.js#L29
we need to make this:
https://github.com/segmentio/analytics.js-integrations/blob/master/lib/quantcast.js#L51
contain a normal pageview things:
https://github.com/segmentio/analytics.js-integrations/blob/master/lib/quantcast.js#L93-L98
@ianstormtaylor @yields @calvinfo high priority sorry!
Here's an example of their snippet:
<!-- Google Tag Manager -->
< noscript > < iframe src = "//www.googletagmanager.com/ns.html?id=GTM-D7QNF"
height = "0"
width = "0"
style = "display:none;visibility:hidden" > < /iframe></noscript > < script > (function (w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({
'gtm.start': new Date().getTime(),
event: 'gtm.js'
});
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s),
dl = l != 'dataLayer' ? '&l=' + l : '';
j.async = true;
j.src =
'//www.googletagmanager.com/gtm.js?id=' + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', 'GTM-D7QNF'); < /script>
<!-- End Google Tag Manager -->
and their interface:
http://grab.by/sfjK
There've been a lot of requests for us to add support for Google Analytics Custom Dimensions and Metrics. This issue pulls together a bunch of discussions like segmentio/analytics.js#192 into what I hope is a basic outline of how it should work. We'll want to finish off #64 before doing this, and will probably only support custom dimensions and metrics for universal.
ga('set',...)
attaches to pageviews and custom event tracking, but doesn't make a request by itself. So it needs to be called before ga('send', 'pageview');
for example.metrics
and dimensions
need to be mapped separately, like props
and eVars
for Omniture.set
should be included for identify
, track
, page
and group
.Thanks to @flowstack for his clarification, there are three different times we'll need to inspect the mappings:
initialize
: map the user traits and group traits, call set
.pageview
: map the page
method properties
, include as additional argument.track
method properties
, include as additional argument.1 and 2 are inside the .page()
method, while 3 is inside the .track()
method.
this one is just a javascript snippet so should be pretty quick
is it me, or tests are really slow ?
anyway i'm thinking of splitting them so that test=mixpanel make test
runs mixpanel
tests and make tests
runs all tests.
thoughts ?
identify()
sends the username as .handle
to heap.
heap docs read:
email and handle are special user properties. Once assigned, they uniquely identify a user. This means no two users in your app may share the same email or handle.
shouldn't we send the id
as .handle
?
Big thanks to the Mixpanel guys, they suggested that the main use case for increment is to count the number of times people do an event in Mixpanel People.
This is possible with the mixpanel.people.increment()
command and $add
on the server-side.
https://mixpanel.com/help/reference/http
Users would provide an events
array that they want to be translated into increment()
calls, similar to ad conversion pixels (but just a list, not a map). Any event on that list would be translated into both an increment()
call and a call to set a people property for the date of this most recent event. That last part was suggested by the Mixpanel team so that in People you can query by recently active not just total counts.
especially after we normalize traits etc just before we pass them to integrations.
docs here:
http://www.visitorjs.com/
We have the inbox turned off:
But it still shows up on our blog:
but we can see that its off in the loaded settings:
apparently i'm real dumb, and this is how Lucky Orange
should actually be identifying: http://help.luckyorange.com/knowledgebase/articles/256737-passing-in-custom-user-data
dunno where i got what i got from
This would mean support for identify in GA Universal. We'd need a setting that defaults to false for letting people use identify with GA. We should probably also make sure people don't send emails to GA since that's against their terms of service.
Docs here: https://developers.google.com/analytics/devguides/collection/analyticsjs/user-id
From Intercom:
In Intercom's JavaScript, the method call is trackEvent instead of trackUserEvent
Is there any documentation on how to use the Facebook Ads or Bronto integrations without the Segment.io service? I've been looking here, here, and digging through the intergrations souce code - but can't seem to get a grasp on what the bronto / facebook provider settings should look like in the initialize hash - and how to property call track for both. Thanks!
I'm wondering if it would be possible to get GA to play nice with the identify call somehow by using the clientId setting on the tracker:
https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#create
We should not send any personally identifiable information to GA, but nothing stops us from re-using an identifier on our end to be able to correctly track users across sessions/devices and using server-side events.
This would allow people to run Classic alongside Universal, and clean up the code/interface since some of the options are only available for Classic.
Currently we have a big switch between the two:
https://github.com/segmentio/analytics.js-integrations/blob/master/lib/google-analytics.js#L52-L65
Would be nicer to have a separate google-analytics-universal.js
and google-analytics-classic.js
for each version. It'll make it nice and easy to deprecate classic down the road too.
I enabled BugSnag and put my API key in on segment.io, but I'm getting this error in console.
[Bugsnag] Invalid API key 'undefined'
Any help? No errors are being logged at BugSnag, and I noticed that the docs for BugSnag are not online currently but accessible via URL
OS: OS X 10.9.2
Node: 0.10.26
Upon a clean build of master:
Error: EMFILE, too many open files '/Users/michael.leaney/code/analytics.js-integrations/components/component-clone/component.json'
at Object.fs.openSync (fs.js:427:18)
at fs.readFileSync (fs.js:284:15)
at Builder.json (/Users/michael.leaney/code/analytics.js-integrations/node_modules/component/node_modules/component-builder/lib/builder.js:428:13)
at new Builder (/Users/michael.leaney/code/analytics.js-integrations/node_modules/component/node_modules/component-builder/lib/builder.js:62:22)
at /Users/michael.leaney/code/analytics.js-integrations/node_modules/component/node_modules/component-builder/lib/builder.js:649:25
at next (/Users/michael.leaney/code/analytics.js-integrations/node_modules/component/node_modules/component-builder/lib/builder.js:291:14)
at Builder.lookup (/Users/michael.leaney/code/analytics.js-integrations/node_modules/component/node_modules/component-builder/lib/builder.js:307:3)
at /Users/michael.leaney/code/analytics.js-integrations/node_modules/component/node_modules/component-builder/lib/builder.js:646:14
at /Users/michael.leaney/code/analytics.js-integrations/node_modules/component/node_modules/component-builder/node_modules/batch/lib/batch.js:65:5
at Array.forEach (native)
make: *** [build] Error 8
There's no public registration, but here's some hints I dug up:
https://github.com/jorgegorka/the_tracker#kenshoo-conversion-pixel
https://github.com/jorgegorka/the_tracker/blob/master/lib/the_tracker/trackers/kenshoo.rb
https://gist.github.com/justinboyle/7875832
Looks like it should implement the "Completed Order" method for conversion tracking.
apparently they take a revenue_amount
value instead of revenue
Hi. I'm the founder of Errorception. I'm filing this bug report since a customer complained about broken Errorception integration through segment.io.
When an error occurs, and the integration is through segment.io, the data that's posted to the Errorception server looks as follows:
[{"message":"U","url":"n","line":"c","method":"1","column":"a","when":"after","page":"..."}]
Instead, the message, URL, line, and column parameters above should have meaningful values. Right now, the values are U, n, c, a, which is likely because the string "Uncaught exception..." is getting broken up into multiple arguments.
In my experience, this is probably because of a bad .apply
call.
For your reference, this is what the Errorception tracking snippet originally looks like, line breaks and whitespace added for clarity:
<script>
(function(_,e,rr,s) {
_errs = [s];
var c = _.onerror;
_.onerror = function() {
var a = arguments;
_errs.push(a);
c && c.apply(this,a)
};
var b = function() {
var c = e.createElement(rr), b = e.getElementsByTagName(rr)[0];
c.src = "//beacon.errorception.com/" + s + ".js";
c.async = true;
b.parentNode.insertBefore(c,b)
};
_.addEventListener?_.addEventListener("load", b, false):_.attachEvent("onload", b)
})(window, document, "script", "project-id-here");
</script>
The key line, where I think stuff I breaking, is the equivalent _errs.push(arguments)
in the segment.io integration. It appears that on-error could be responsible, but I'm not entirely sure.
_errs.push
, which is really an array#push method, requires the argument object itself, and not that the arguments should be applied to it, which I think is the reason for the problem.
Do let me know if there's any way I can help resolve this.
yo @yields i'm going to prep a pull request for this guy.
i finally got on the phone with bonobos and curebit to fully understand how this integration works. this jsfiddle helped:
http://jsfiddle.net/iurevych/HL2gQ/
The flow is:
register_affiliate
should get called with the iframe
parameters and the campaign_tags
.affiliate_member
.register_purchase
call.The iframe
parameters are fixed settings that we can add to the settings page. Chill.
The campaign_tags
depend on the page. So https://ayr.com/share should have the campaign tag share
. These tags don't necessarily match the url, but are different for different pages.
Through some testing with the jsfiddle, it looks like we can easily call register_affiliate
twice... once on page load and again if they identify. In either case we need to determine the campaign_tags
based on the page url matching.
In terms of future value here, the weird thing we need to develop is a page url regex matcher. On the sales call with USA Today, they really really wanted to be able to control which integrations load on which pages. It's come up before as well. So the page url matcher will be useful again. I think that would be a feature we would apply universally across all integrations. I'll file a separate issue about it.
The _fp.event label structure for Advertise should only have one level. So _fp.event.Browse.Homepage View should be _fp.event.Homepage View. Looks like most pages have two levels of labels, so we’ll want to make that just one for all pages.
asked this for clarification:
Kirk, can I get a quick clarification: should the advertise structures only ever have a single level? or is it just in this case for the Home page. What about a case for something like categorized product pages? Thanks.
Looks like we'll need a new Quantcast option, thanks to their team for the help!
The Quantcast Measure (format “page.pants”) and Quantcast Advertise (format “_fp.event.pants”) products are separate and we generally would not include both label formats in a single tag. So the event label could include either:
ADVERTISE: _fp.event.Pants (please make sure the e in “event” is lowercase)
Or
MEASURE: news.local,author.JohnSmith (This is a freeform field that could be period or comma separated.)
Quantcast has been super helpful, and has explained that a few changes would really improve the integration.
Here's an ideal call:
_qevents.push({
qacct: "p-sample",
labels: "Customer.New,_fp.event.Homepage,_fp.customer.New",
orderid: "rt12564", // text field for orderid, invoice number, etc.
revenue: "22.36", // text field to allow pass back of revenue amounts
event: "refresh" // text field with acceptable values of "click" or "refresh"
});
Labels are "a comma separated text field that is configurable". Here are the example labels for an e-commerce site:
_fp.event.Homepage
_fp.event.New
_fp.event.Pants
_fp.event.Suiting
_fp.event.Shirts Dress
_fp.event.Shirts Casual
_fp.event.ShoppingCart
_fp.event.Checkout
_fp.event.PurchaseConfirmation (where we’d also want the purchase amount and orderID pulled into the tag)
So basically, on page
calls we should include this _fp.event.page
and _fp.event.category
... and for events we should include the event name.
We'll want to add an e-commerce handler for Completed Order as well. These _fp.event.whatever
labels do not need to match exactly.
Also, we'll generally want to send over .revenue()
whenever it's available for track
calls.
I'm drafting this up as a pull request now.
When selecting a size or “add to cart” the revenue value is being populated as “undefined”. We actually don’t need revenue in any of the upper funnel pages. We only need it on the final purchase confirmation page.
i think this line needs to be !=
instead
I'm thinking we might want a way to let users specify which properties go to which services
https://support.google.com/analytics/answer/2444872?hl=en&ref_topic=2611283
Google finally supports this so let's add it too :) should be an easy one, just need this in the snippet for universal:
ga('require', 'displayfeatures');
looks like they changed their tracker code (made it nicer) so we should remember to update at some point
Bad link back to Analytics.js repo. 🍰
This repository houses all of the integrations that get built into analytics.js. We...
Should link to:
https://github.com/segmentio/analytics.js
It has come to my attention that we should be using adwords conversion label for the mapping portion of the setting. We only need to collect google_conversion_id once since it will be the same across conversion events under one adwords account.
<!-- Google Code for other conversion Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
// refers to adwords account id
var google_conversion_id = 995306727;
var google_conversion_language = "en";
var google_conversion_format = "2";
var google_conversion_color = "ffffff";
// unique label for each event
var google_conversion_label = "5PgCCLnOggcQ59nM2gM";
var google_conversion_value = 0;
var google_remarketing_only = false;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/995306727/?value=0&label=5PgCCLnOggcQ59nM2gM&guid=ON&script=0"/>
</div>
</noscript>
window.Optimizely.data.experiments contains data on all experiments in the project.
As is, the integration is copying all experiments into the user's attributes, which makes it hard/impossible to query for events that were triggered by users who are seeing / have seen a given experiment or variation.
Would it not be better to only report experiments included in window.Optimizely.data.activeExperiments?
in most integrations we use convert-date
which is great except that it doesn't handle strings
, numbers
etc...
fix all of those so analytics.js users can safely use s
, ms
, strings
or Date
.
Events:
analytics.track('event name');
becomes
__adroll.record_user(adroll_segment: 'event name');
Event properties will include order_id
and revenue
:
analytics.track('event name', {order_id: '12345', revenue: 50});
When translated to AdRoll it will become:
__adroll.record_user(adroll_segment: 'event name');
adroll_conversion_value_in_dollars = 50;
adroll_custom_data = {"ORDER_ID": "12345", "USER_ID":"98765"};
mixpanel, kissmetrics and any others would make for really powerful analysis
seems pretty straightforward: https://developers.google.com/analytics/devguides/collection/analyticsjs/user-timings
this is for universal analytics only
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.