Skip to content

Commit

Permalink
chore: update ga tracking (ElemeFE#14560)
Browse files Browse the repository at this point in the history
* chore: update ga tracking

* chore: update development mock
  • Loading branch information
iamkun authored and ziyoung committed Mar 4, 2019
1 parent e52c7e0 commit 608f1ba
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"mocha": true
},
"globals": {
"ga": true,
"expect": true,
"sinon": true
},
Expand Down
1 change: 1 addition & 0 deletions examples/components/theme-configurator/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export default {
getVars()
.then((res) => {
defaultConfig = res;
ga('send', 'event', 'ThemeConfigurator', 'Init');
})
.catch((err) => {
this.onError(err);
Expand Down
3 changes: 3 additions & 0 deletions examples/index.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,7 @@
ga('send', 'pageview');
});
</script><% } %>
<% if (process.env.NODE_ENV !== 'production') { %><script>
var ga = function() {};
</script><% } %>
</html>
10 changes: 8 additions & 2 deletions examples/pages/template/resource.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,21 @@
<img src="~examples/assets/images/Axure-Components.svg" alt="">
<h3><%= 3 ></h3>
<p><%= 4 ></p>
<a href="https://github.com/ElementUI/Resources/raw/master/Element_Components_v2.0.0.rplib"><%= 5 ></a>
<a
onclick="ga('send', 'event', 'ResourceDownload', 'Download', 'Axure');"
href="https://github.com/ElementUI/Resources/raw/master/Element_Components_v2.0.0.rplib"
><%= 5 ></a>
</div>
</li>
<li>
<div class="card">
<img src="~examples/assets/images/Sketch-Template.svg" alt="">
<h3><%= 6 ></h3>
<p><%= 7 ></p>
<a href="https://github.com/ElementUI/Resources/raw/master/Element%20UI%20Kit_v2.0.sketch"><%= 5 ></a>
<a
onclick="ga('send', 'event', 'ResourceDownload', 'Download', 'Sketch');"
href="https://github.com/ElementUI/Resources/raw/master/Element%20UI%20Kit_v2.0.sketch"
><%= 5 ></a>
</div>
</li>
<!--<li>-->
Expand Down

0 comments on commit 608f1ba

Please sign in to comment.