Skip to content

Unable to track event  #519

@shaistan26

Description

@shaistan26

HI,
I am trying to send an event using the latest version of Optimizely SDK (3.10.3).
There are not exceptions/errors while sending event However, i am unable to see any numbers in my Optimizely experiment dashboard. Below is the extracted code which i use to initialise the Optimizely client and send the tracking event request.

public static void main(String[] args) {
        try {
            long pollingInterval = 30;
            ProjectConfigManager configManager = HttpProjectConfigManager.builder()
            .withSdkKey("xxxxxxxxxxx")
                    .withPollingInterval(pollingInterval, TimeUnit.MINUTES)
            .build();

           EventHandler getEventHandler = AsyncEventHandler.builder().build();
            ForwardingEventProcessor getEventProcessor =
                    new ForwardingEventProcessor(getEventHandler, null);
            
        Optimizely optimizely = Optimizely.builder()
            .withConfigManager(configManager)
                .withEventProcessor(getEventProcessor)
            .build();
        
            String userId = UUID.randomUUID().toString();
            OptimizelyUserContext userContext = optimizely.createUserContext(userId);

            Map<String, Object> attributes = new HashMap<>();
            attributes.put("sampleAttribute","SAMPLE");

            userContext.trackEvent("sample_event", attributes);
        } catch (Exception e) {
            System.out.println("##########I am exception############: " + e.getMessage());
        }
    }

but there are no updates on the dashboard:
Screenshot 2023-06-06 at 17 29 27

PS: I have matched experiment name in code and on dashboard is same .
Also i have checked event id used in code and on dashboard is same.

I would appreciate if some one could give me some pointers and/or point me to a working example of tracking event using Optimizely java SDK

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions