Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- (function() {
- function getTrackerName(device) {
- var TRACKER_ID_DT = 'UA-708051-1';
- var TRACKER_ID_MOB = 'UA-708051-35';
- var trackers = ga.getAll();
- var trackerName = 't0';
- trackers.forEach(function(tracker) {
- var goalTrackerName = tracker.get('name');
- var goalTrackerId = tracker.get('trackingId');
- if (device === 'desktop' && goalTrackerId === TRACKER_ID_DT) {
- trackerName = goalTrackerName;
- } else if (device != 'desktop' && goalTrackerId === TRACKER_ID_MOB) {
- trackerName = goalTrackerName;
- }
- });
- return trackerName;
- }
- adoric.on('lightbox:after:show', function(e) {
- var trackerName = getTrackerName(e.lightbox.options.type);
- window.ga && window.ga(trackerName + '.send', 'event', {
- eventCategory: 'Adoric - ' + e.lightbox.options.campaignTitle,
- eventAction: 'impression',
- eventLabel: 'Adoric - ' + e.lightbox.options.title
- });
- });
- adoric.on('lightbox:after:close', function(e) {
- var trackerName = getTrackerName(e.lightbox.options.type);
- window.ga && window.ga(trackerName + '.send', 'event', {
- eventCategory: 'Adoric - ' + e.lightbox.options.campaignTitle,
- eventAction: 'Close or Transition',
- eventLabel: 'Adoric - ' + e.lightbox.options.title
- });
- });
- adoric.on('lightbox:after:click', function(e) {
- var trackerName = getTrackerName(e.lightbox.options.type);
- window.ga && window.ga(trackerName + '.send', 'event', {
- eventCategory: 'Adoric - ' + e.lightbox.options.campaignTitle,
- eventAction: 'Click',
- eventLabel: 'Adoric - ' + e.lightbox.options.title
- });
- });
- adoric.on('form:after:submit', function(e) {
- var trackerName = getTrackerName(e.lightbox.options.type);
- window.ga && window.ga(trackerName + '.send', 'event', {
- eventCategory: 'Adoric - ' + e.lightbox.options.campaignTitle,
- eventAction: 'Click',
- eventLabel: 'Adoric - ' + e.lightbox.options.title
- });
- });
- })();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment