GithubHelp home page GithubHelp logo

analytics.js-integrations's People

Contributors

amillet89 avatar araddon avatar calvinfo avatar charlesportwoodii avatar cibingeorge avatar coryvirok avatar curtisliu avatar dominicbarnes avatar enriko avatar f2prateek avatar fizerkhan avatar floernoult avatar harrietgrace avatar ianstormtaylor avatar itzsuresh avatar lambtron avatar lancejpollard avatar mrtravisb avatar n2parko avatar ndhoule avatar nemo avatar pchukwura avatar realyze avatar reinpk avatar shawnfrench avatar simontabor avatar sperand-io avatar thomassittig avatar usmanity avatar yields avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

analytics.js-integrations's Issues

tests

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 ?

Use Adwords Label for Event Mapping

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&amp;label=5PgCCLnOggcQ59nM2gM&amp;guid=ON&amp;script=0"/>
</div>
</noscript>

gosquared tracker updated

looks like they changed their tracker code (made it nicer) so we should remember to update at some point

quantcast advertise needs to be one-level nested

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.

quantcast revenue ends up being "undefined"

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

heap bug ?

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 ?

Improve Quantcast integration

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

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.

OrderId and Revenue

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.

Quantcast should send labels based on Measure or Advertise

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.)

Add support for AdRoll events and conversion value

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"};

intercom user detaches from the company

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).

add support for google tag manager

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

add more debug's

especially after we normalize traits etc just before we pass them to integrations.

specifying properties

I'm thinking we might want a way to let users specify which properties go to which services

split google analytics in two: classic and universal

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.

google analytics canonical url should include utm parameters

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?

Google Analytics Custom Dimensions and Metrics

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.
  • The mapping and call to 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:

  1. During initialize: map the user traits and group traits, call set.
  2. During pageview: map the page method properties, include as additional argument.
  3. During event calls: map the track method properties, include as additional argument.

1 and 2 are inside the .page() method, while 3 is inside the .track() method.

BugSnag: Invalid API key 'undefined'

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

support Mixpanel increment via an events list

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.

Error: EMFILE, too many open files

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

handling dates

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.

add adwords retargeting

  1. Place the Google Remarketing Tag on all pages of your website. To get started, you'll need to place the remarketing tag that you'll find at the end of this email on all the pages on your website. You can also find the code in the Shared Library section of your AdWords account!

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.

  1. Use tag validations tools to ensure proper implementation. Review whether the tag was properly implemented by using the recommended tag tools:

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&amp;guid=ON&amp;script=0"/>
</div>
</noscript>

Incorrect data being sent to Errorception

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.

curebit should call register_affiliate based on page url + identify

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:

  1. User opens page, which is blank.
  2. Curebit's register_affiliate should get called with the iframe parameters and the campaign_tags.
    * If the user loading the page is known, they should be passed in as the affiliate_member.
    * If the user is not known, they'll be shown a Curebit signup form.
  3. The iframe is loaded by Curebit.
  4. Later, during purchase checkout the social referral ROI is determined through the 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.

Documentation Request

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.