Skip to content

Commit c44e3c2

Browse files
committed
Merge pull request #15 from optimizely/generate_impression_event_url
Adds function to generate an impression event url with respect to a p…
2 parents 135833a + 1d66b6b commit c44e3c2

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

optimizely/event.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ type Event struct {
3131
params url.Values
3232
}
3333

34+
// GetURLForImpressionEvent returns an url for sending impression / conversion
35+
// events.
36+
// project_id: ID for the project
37+
func GetUrlForImpressionEvent(project_id string) string {
38+
return fmt.Sprintf(OFFLINE_API_PATH, project_id)
39+
}
40+
3441
// Add experiment to variation mapping to the impression event
3542
// experiment_key: Experiment which is being activated
3643
// variation_id: id for variation which would be presented to the user

optimizely/optimizely.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ func (client *OptimizelyClient) Activate(experiment_key string, user_id string,
5050
variation_id := ""
5151
impression_event := CreateImpressionEvent(
5252
client, experiment_key, variation_id, user_id, attributes)
53+
impression_event_url := GetUrlForImpressionEvent(client.project_config.ProjectId)
5354

5455
}
5556

0 commit comments

Comments
 (0)