Skip to content

Instantly share code, notes, and snippets.

@marcusschiesser
Forked from anonymous/launchrock_adwords.js
Created September 22, 2016 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcusschiesser/36727dedd8f04046665c081fd8f2d28f to your computer and use it in GitHub Desktop.
Save marcusschiesser/36727dedd8f04046665c081fd8f2d28f 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