Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Analytics Allow overriding documentTitle/documentPath/documentHostName #927

Merged
merged 1 commit into from May 3, 2021

Conversation

kouz75
Copy link
Contributor

@kouz75 kouz75 commented May 2, 2021

Proposed changes

Adding customParameters at the end of the return object will allow us to override documentTitle/documentPath/documentHostName.

Add following command will override default page title by "MyIntentName"
this.$googleAnalytics.setParameter('documentTitle','MyIntentName');

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

@aswetlow
Copy link
Member

aswetlow commented May 3, 2021

Thanks

@aswetlow aswetlow merged commit 6bff8b4 into jovotech:master May 3, 2021
@freiSMS
Copy link
Contributor

freiSMS commented May 3, 2021

Nice idea @kouz75 . We also overwrite some Google Analytics methods. We use class inheritance. Maybe this could be useful for you in cases where you want to always overwrite them. The protected Google Analytics methods like getPageName(), getUserId() etc. are intended to cover cases where developers want to have their own behavior. For example you could use your own userIds (like bellow) or do some stuff before sending data via the track method.

export class CustomGoogleAnalyticsAlexa extends GoogleAnalyticsAlexa {
    protected getUserId(jovo: Jovo): string {
      return Custom.userIdFromDatabase()
}

@kouz75 kouz75 deleted the google-analytics branch May 3, 2021 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants