Skip to content

Added dc.js support through script tag id and data attribute #51

wants to merge 15 commits into from

5 participants


refs pull request #33

LinsBC commented Oct 17, 2013

Is this good to use yet? I have a client using GAS who wishes to integrate DoubleClick so wondering if I can advise him to implement this method?

LinsBC commented Oct 17, 2013

Thanks Tom,

Should I be warning the client that this is in beta? And if so, any ideas when it might be migrated to the main version?


@LinsBC -- test it somewhere first w/ the Google Analytics Debugger (Chrome) and if pageviews fire it should be fine to be "out of beta"

@BrianKatz -- I coded a shim like this before at my past employ (30M visits / day between properties). We saw less than a 0.25% drop now that adblock whitelisted the dc.js file. The fallback seemed a bit overkill for it and sometimes double loaded / generated false positives. Would not recommend it for effort/priority.


Thanks for this! I'm excited to start using the new version, but I'm afraid I'm not familiar enough with how github works to download new version. I checked the download and releases page, and the latest version 1.11.0 isn't listed.

Will something be uploaded there, or do I need to do something in github to create the file(s)?

Sorry I'm such a noob!

tomfuertes added some commits Oct 18, 2013
@tomfuertes tomfuertes added grunt-contrib-clean to build process 9834701
@tomfuertes tomfuertes added banner to min files 90578a1
@tomfuertes tomfuertes Merge remote-tracking branch 'origin/develop' into dc.js
* origin/develop:
  Outbound events are non-interactive now
  Allow negative event values
  Don't push GAS functions inside _gaq.
  Extra checks on the live handler, fixes issue with ie8
@tomfuertes tomfuertes lint 4d519dd
@tomfuertes tomfuertes getElementByID !== getElementById 9a2a8b7

Tested locally and confirmed it's loading dc.js! You can download the release candidate zip at this link:

The new snippet for how to load it can be found here:

For now you'll have to host your own gas.min.js somewhere until the pull request is merged and 1.11.0 is shipped to the CDN.


Ping @DarrenCarterMD and @LinsBC -- release candidate script is zipped and linked to in the comment above

@tomfuertes tomfuertes was assigned Oct 18, 2013
LinsBC commented Oct 23, 2013

Thanks Tom. That's very helpful and much appreciated.


O.o Thanks and apologies! The new build system doesn't handle ascii/unicode in the same way. I deprecated/removed the offending function/code. You can download the patched release candidate below:

-- ping @LinsBC per the @DarrenCarterMD bug report above.


@DarrenCarterMD Sorry I pasted the old link in the original comment and edited it soon thereafter, but apparently not before the notification emails went out!

Try this one:

One more time for @LinsBC


@DarrenCarterMD Sure, which urls?


On these two sites, it's not working.

Both have the same errors from the Google Tag Manager extension in Chrome:
From Google Tag Manager:
Error: No HTTP response detected
Error: Missing ga.js script

On this site, the tag is working.

There are a couple differences in implementation: 1) the script is in the body and not the head. 2) I also am using a hosted version of the script and don't have it locally. Could either be part of it?

Much thanks!


The first two urls don't actually reference an online script.

Change all of your current src's from ga.src = '//demo/js/gas.min.js'; to ga.src = '//'; like it is on the working site.

The universal analytics implementation on the first one is also missing a closing tag


But the current src's do point to a local instance of the gas.min.js script. For example, is present. Why doesn't the local implementation work?

Thanks for the catching the universal tracking tag issue!

  • Site 1: '//demo/js/gas.min.js'; points to http://demo/js/gas.min.js
  • Site 2: The second sites script wasn't copied over correctly and has some sort of re-minification problem
  • Site 3: Currently working and at the url mentioned above //

That solves it all. I'll go with my hosted file.

Thanks, again!


will the 1.11.0 gas.min.js will be brought to the CDN?
Will there be any changes in the documentation?

I can see no chnages on the main page since 1 year...


Working on this today! Have a PR with CDNJS (cdnjs/cdnjs#2207) to get 1.11.0 out on the CDN. I'll publish the 1.11.0 tag to master once that PR goes live.

Changelog Preview of 1.11.0 can be found here and/or read below:


  • Display Advertising (dc.js) support (9d4bb3e)
  • Build system moved to Grunt (f3921fc)
  • Removed _sanitizeString helper function (e042350)
  • Outbound events are non-interactive now (9585c4e)
  • Allow negative event values (ce4515c)
  • Don't push GAS functions inside _gaq. (18c5e79)
  • Extra checks on the live handler, fixes issue with ie8 (ae1d554)

cc @philippschneider


1.11.0 has landed! Pull request rebased and merged into develop/master

If you want to install/update, instructions can be found on the front page README

@tomfuertes tomfuertes closed this Nov 24, 2013
@tomfuertes tomfuertes deleted the unknown repository branch Nov 24, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.