File tree Expand file tree Collapse file tree
springfield/firefox/templates/firefox/all Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
55 */
66
7- import StubAttributionConsent from '../../base/stub -attribution/stub -attribution-consent .es6' ;
7+ import DownloadAttribution from '../../base/download -attribution/download -attribution.es6' ;
88import TrackProductDownload from '../../base/datalayer-productdownload.es6' ;
99import MzpModal from '@mozilla-protocol/core/protocol/js/modal' ;
1010
@@ -86,12 +86,14 @@ import MzpModal from '@mozilla-protocol/core/protocol/js/modal';
8686 window . cms . Flare26 . initDialogs ( ) ;
8787 }
8888
89- // init stub attribution & event tracking for GA4
89+ // Attach existing download attribution to download links
9090 if ( downloadButtons && downloadButtons . length > 0 ) {
91- if ( StubAttributionConsent ) {
92- // We cannot rely on DOM ready as this section is partially fetched
91+ if ( DownloadAttribution ) {
92+ // download-attribution-init will run on page load and set any allowed download attribution data
93+ // But download links may not be rendered on DOM ready as this section is partially fetched
94+ // So we directly call the function that applies data to links (if no data, does nothing)
9395 // This flow is scheduled for refactoring: https://github.com/mozmeao/springfield/issues/258
94- StubAttributionConsent . init ( ) ;
96+ DownloadAttribution . applyAttributionDataToLinks ( ) ;
9597 }
9698
9799 for ( let i = 0 ; i < downloadButtons . length ; ++ i ) {
Original file line number Diff line number Diff line change 651651 ],
652652 "name" : " firefox_all"
653653 },
654+ {
655+ "files" : [
656+ " js/firefox/all/all-init-v2.es6.js"
657+ ],
658+ "name" : " firefox_all-v2"
659+ },
654660 {
655661 "files" : [
656662 " js/libs/classlist.js" ,
Original file line number Diff line number Diff line change 5050{% endblock %}
5151
5252{% block js %}
53- {{ js_bundle('firefox_all') }}
53+ {% if switch('enable-attribution-refactor') %}
54+ {{ js_bundle('firefox_all-v2') }}
55+ {% else %}
56+ {{ js_bundle('firefox_all') }}
57+ {% endif %}
5458{% endblock %}
You can’t perform that action at this time.
0 commit comments