Commit 22e19b4a authored by David O'Regan's avatar David O'Regan

Merge branch '346644-track-ultimate-banner' into 'master'

Add structured tracking to ultimate banner

See merge request gitlab-org/gitlab!80109
parents 90fa4293 10694fa0
- is_dismissable = local_assigns.fetch(:is_dismissable, true)
- callout = local_assigns.fetch(:callout, Users::CalloutsHelper::ULTIMATE_TRIAL)
- button_css_class = is_dismissable ? 'mr-3' : ''
- banner_title = 'ultimate_banner'
.gl-display-none.gl-md-display-block.container-limited{ class: 'gl-pt-6! gl-pb-2!' }
.gl-display-none.gl-md-display-block.container-limited{ class: 'gl-pt-6! gl-pb-2!', data: { track_action: 'render', track_label: banner_title } }
.user-callout.promotion-callout.thin-callout.js-gold-trial-callout{ class: 'gl-mt-0!', data: { uid: 'trial_callout_dismissed', feature_id: callout, dismiss_endpoint: callouts_path } }
.gl-card.gl-px-8.gl-py-6
.gl-card-body.gl-display-flex{ class: 'gl-p-0!' }
......@@ -13,7 +14,7 @@
%p
%span= _('Try all GitLab has to offer for 30 days.')
%span.d-none.d-sm-inline= _('No credit card required.')
= link_to _('Start your free trial'), callouts_trials_link_url, class: "btn btn-confirm gl-button mt-2 mt-sm-0 #{button_css_class}", target: '_blank', rel: 'noopener noreferrer'
= link_to _('Start your free trial'), callouts_trials_link_url, class: "btn btn-confirm gl-button mt-2 mt-sm-0 #{button_css_class}", target: '_blank', rel: 'noopener noreferrer', data: { track_action: 'click_button', track_label: 'start_your_trial', track_property: banner_title }
- if is_dismissable
%button.btn.gl-banner-close.btn-default.btn-sm.gl-button.btn-default-tertiary.btn-icon.close.js-close{ class: 'gl-opacity-10!', type: 'button', 'aria-label' => _('Dismiss trial promotion') }
%button.btn.gl-banner-close.btn-default.btn-sm.gl-button.btn-default-tertiary.btn-icon.close.js-close{ class: 'gl-opacity-10!', type: 'button', 'aria-label' => _('Dismiss trial promotion'), data: { track_action: 'dismiss_banner', track_label: banner_title } }
= sprite_icon('close', css_class: 'dismiss-icon gl-text-gray-700!')
......@@ -27,8 +27,17 @@ RSpec.shared_examples 'dashboard ultimate trial callout' do
visit page_path
expect(page).to have_selector '.promotion-callout'
expect(page).to have_selector('[data-track-action=render]')
expect(page).to have_selector('[data-track-label=ultimate_banner]')
find('.promotion-callout .js-close').click
page.within('.promotion-callout') do
expect(page).to have_selector('[data-track-action=click_button]')
expect(page).to have_selector('[data-track-label=start_your_trial]')
expect(page).to have_selector('[data-track-action=dismiss_banner]')
expect(page).to have_selector('[data-track-label=ultimate_banner]')
find('.js-close').click
end
expect(page).not_to have_selector '.promotion-callout'
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment