Skip to content

Instantly share code, notes, and snippets.

@cyberlex404
Created January 11, 2018 15:43
Show Gist options
  • Select an option

  • Save cyberlex404/73a61e2da6427f0194e763ee9ff5adc8 to your computer and use it in GitHub Desktop.

Select an option

Save cyberlex404/73a61e2da6427f0194e763ee9ff5adc8 to your computer and use it in GitHub Desktop.
(function ($, Drupal, settings) {
"use strict";
Drupal.behaviors.housingActionContact = {
attach: function (context) {
var button = $(".house-action-phones");
var housingId = button.data('housing');
var goalParams =
{
housingId: housingId,
action: 'phones'
};
function goalCallback () {
console.log(goalParams);
}
button.once('hous-contact-behaviors').on('click', function () {
yaCounter45769347.reachGoal('housing_contact_action', goalParams, goalCallback);
});
}
};
Drupal.behaviors.housingActionOrder = {
attach: function (context) {
var button = $(".house-action-order");
var housingId = button.data('housing');
var goalParams =
{
housingId: housingId,
action: 'order'
};
function goalCallback () {
console.log(goalParams);
ga('set', 'dimension1', housingId);
}
button.once('hous-order-behaviors').on('click', function () {
yaCounter45769347.reachGoal('housing_order_action', goalParams, goalCallback);
});
}
}
})(jQuery, Drupal, drupalSettings);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment