Skip to content

Commit

Permalink
feat(docs): update google analytics to gtag + publish to s3 (#727)
Browse files Browse the repository at this point in the history
* Old google analytics was changed to gtag
* publish to s3

Co-authored-by: Sergei Iartsev
Co-authored-by: Anton Malinskiy <[email protected]>
  • Loading branch information
austyh and Malinskiy committed Jan 9, 2023
1 parent 4990fe0 commit 4f7f11d
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 32 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build and deploy docs

on:
push:
branches:
- develop

jobs:
github-pages:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: helaili/[email protected]
with:
jekyll_src: docs
gem_src: docs
build_dir: docs_build_dir
build_only: true
- uses: jakejarvis/s3-sync-action@master
with:
args: --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'eu-central-1'
SOURCE_DIR: 'docs/docs_build_dir'
19 changes: 0 additions & 19 deletions .github/workflows/github-pages.yml

This file was deleted.

4 changes: 2 additions & 2 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ subtitle: 'Cross-platform test runner for Android and iOS'
# disqus_shortname: ''

# if you use google analytics, add your tracking id here
google_analytics_id: 'UA-131132823-2'
google_analytics_id: 'G-7RE7PPY2QW'

# Enable/show navigation. There are there options:
# 0 - always hide
Expand All @@ -30,7 +30,7 @@ sections: [

# Keep as an empty string if served up at the root. If served up at a specific
# path (e.g. on GitHub pages) leave off the trailing slash, e.g. /my-project
baseurl: '/marathon'
baseurl: ''

# Dates are not included in permalinks
permalink: none
Expand Down
2 changes: 1 addition & 1 deletion docs/_data/commons.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Marathon"
google_analytics: "UA-131132823-2"
google_analytics: "G-7RE7PPY2QW"
description: "Cross-platform test runner written for Android and iOS projects"
keywords: "android, testing, testing-tool, test-runner, espresso, uitest, uitesting, uitests, ios, marathon, xcrun, instrumentation, instrumentation-tests, gradle, parallel, performance"
20 changes: 10 additions & 10 deletions docs/_includes/_google-analytics.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<script
async
src="https://www.googletagmanager.com/gtag/js?id={{ site.data.commons.google_analytics }}"
></script>
<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date(); a = s.createElement(o),
m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');

ga('create', '{{ site.data.commons.google_analytics }}', 'auto');
ga('send', 'pageview');

window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());

gtag("config", "{{ site.data.commons.google_analytics }}");
</script>

0 comments on commit 4f7f11d

Please sign in to comment.