@@ -78,21 +78,23 @@ export default {
7878 methods: {
7979 onCopySuccess (e ) {
8080 this .success = true
81- const fieldsFilled = {}
82- for (const detail in this .$props .value .attributionDetails ) {
83- fieldsFilled[detail] = this .$props .value .attributionDetails [detail] !== ' '
84- }
85- const copiedLicense = {
86- license: this .$props .value .shortName ,
87- // codeType can be either rich-text or html
88- codeType: this .currentSelection ,
89- fieldsFilled: fieldsFilled
81+ if (process .env .NODE_ENV === ' production' ) {
82+ const fieldsFilled = {}
83+ for (const detail in this .$props .value .attributionDetails ) {
84+ fieldsFilled[detail] = this .$props .value .attributionDetails [detail] !== ' '
85+ }
86+ const copiedLicense = {
87+ license: this .$props .value .shortName ,
88+ // codeType can be either rich-text or html
89+ codeType: this .currentSelection ,
90+ fieldsFilled: fieldsFilled
91+ }
92+ this .$ga .event ({
93+ eventCategory: ' Attribution' ,
94+ eventAction: ' copied' ,
95+ eventLabel: JSON .stringify (copiedLicense)
96+ })
9097 }
91- this .$ga .event ({
92- eventCategory: ' Attribution' ,
93- eventAction: ' copied' ,
94- eventLabel: JSON .stringify (copiedLicense)
95- })
9698 this .$emit (' copied' , { content: e .text })
9799 setTimeout (() => {
98100 this .success = false
0 commit comments