Skip to content

Instantly share code, notes, and snippets.

Created September 22, 2016 17:32
Show Gist options
  • Save anonymous/6d5d6363e184b743bbc16651ce3d3562 to your computer and use it in GitHub Desktop.
Save anonymous/6d5d6363e184b743bbc16651ce3d3562 to your computer and use it in GitHub Desktop.
Add Google Adwords to Launchrock
// you also have to add the JS from the URL http://www.googleadservices.com/pagead/conversion_async.js in the header,
// so the function window.google_trackConversion is available
angular.module("lrSiteApp").config(function ($httpProvider) {
var httpinterceptor = function () {
return {
response: function (result) {
var isCreateReq = result.config.url.match(/site-users\/create/) !== null;
if (isCreateReq) {
window.google_trackConversion({
google_conversion_id: 1, // get it from the adwords website
google_conversion_label: "1", // get it from the adwords website
google_remarketing_only: false
});
}
return result;
}
}
};
$httpProvider.interceptors.push(httpinterceptor);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment