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

Unable to customize pageview eventType #596

Closed
alex-geopro opened this issue Oct 3, 2023 · 7 comments
Closed

Unable to customize pageview eventType #596

alex-geopro opened this issue Oct 3, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@alex-geopro
Copy link

Expected Behavior

I expected the default tracking eventType for pageviews to change from the default [Amplitude] Page Viewed to the value i set.

Current Behavior

It stayed at the default value.

Possible Solution

Not sure.

Steps to Reproduce

See: https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events

Initialize it like this:

      amplitude.init('<api_key>', '<user_id>', { 
        defaultTracking: {
          pageviews: {
            eventType: 'pageview'
          }
        }
      });

Environment

  • Browser SDK Version: 2.2.3
  • Installation Method: <script/> tag
Screenshot 2023-10-02 at 6 08 20 PM
@alex-geopro alex-geopro added the bug Something isn't working label Oct 3, 2023
@alex-geopro
Copy link
Author

alex-geopro commented Oct 3, 2023

Ok I got this working, I had a typo, it should be pageViews not pageviews.

Follow on question: is there a way to customize the event property names? The default ones seem super verbose and have spaces in them etc, seems very non-standard.

Screenshot 2023-10-02 at 6 11 47 PM

I expected the names to be more like:

  • domain
  • path
  • location
  • title
  • url

These are the names normally given to these parameters I believe.

@alex-geopro
Copy link
Author

Also, how can I configure/change the eventType for other default events, like session started etc?

@Mercy811
Copy link
Contributor

Mercy811 commented Oct 3, 2023

Hi @alex-geopro, thanks for choosing Amplitude. Afaik, the SDK doesn't support customizing event name or event property name unfortunately.

@Mercy811 Mercy811 closed this as completed Oct 3, 2023
@alex-geopro
Copy link
Author

alex-geopro commented Oct 3, 2023

Hi @Mercy811 it definitely does, I have it working for the pageview event name. see attached:

Screenshot 2023-10-03 at 11 20 29 AM

@Mercy811
Copy link
Contributor

Mercy811 commented Oct 3, 2023

Other default tracking events are not supported to change event type except pageViews. Please refer to the typings here.

@Mercy811
Copy link
Contributor

Mercy811 commented Oct 3, 2023

Hi @alex-geopro, although there is no direct configurations over default events, you can customize it by a enrichment plugin. Please refer to the docs and an example here. Simply rewrite the event type there if the current event is a session event or other default events you want to rename.

@alex-geopro
Copy link
Author

alex-geopro commented Oct 3, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants