-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(specs): add new events type for insights (#2080)
Co-authored-by: Jessica <j.h_7@yahoo.com>
- Loading branch information
Showing
14 changed files
with
304 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
generators/src/main/java/com/algolia/codegen/cts/lambda/EscapeDollarLambda.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.algolia.codegen.cts.lambda; | ||
|
||
import com.samskivert.mustache.Mustache; | ||
import com.samskivert.mustache.Template; | ||
import java.io.IOException; | ||
import java.io.Writer; | ||
|
||
public class EscapeDollarLambda implements Mustache.Lambda { | ||
|
||
@Override | ||
public void execute(Template.Fragment fragment, Writer writer) throws IOException { | ||
String text = fragment.execute(); | ||
writer.write(text.replace("$", "\\$")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
type: string | ||
enum: [addToCart] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
type: object | ||
title: Added to cart object IDs | ||
description: | | ||
Use this event to track when users add items to their shopping cart unrelated to a previous Algolia request. For example, if you don't use Algolia to build your category pages, use this event. | ||
To track add-to-cart events related to Algolia requests, use the "Added to cart object IDs after search" event. | ||
additionalProperties: false | ||
properties: | ||
eventName: | ||
$ref: './EventAttributes.yml#/eventName' | ||
eventType: | ||
$ref: './ConversionEvent.yml' | ||
eventSubtype: | ||
$ref: './AddToCartEvent.yml' | ||
index: | ||
$ref: './EventAttributes.yml#/index' | ||
objectIDs: | ||
$ref: './EventAttributes.yml#/objectIDs' | ||
objectData: | ||
$ref: './EventAttributes.yml#/objectDataList' | ||
currency: | ||
$ref: './EventAttributes.yml#/currency' | ||
userToken: | ||
$ref: './EventAttributes.yml#/userToken' | ||
timestamp: | ||
$ref: './EventAttributes.yml#/timestamp' | ||
required: | ||
- eventName | ||
- eventType | ||
- eventSubtype | ||
- index | ||
- objectIDs | ||
- userToken |
35 changes: 35 additions & 0 deletions
35
specs/insights/common/schemas/AddedToCartObjectIDsAfterSearch.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
type: object | ||
title: Added to cart object IDs after search | ||
description: | | ||
Use this event to track when users add items to their shopping cart after a previous Algolia request. | ||
If you're building your category pages with Algolia, you'll also use this event. | ||
additionalProperties: false | ||
properties: | ||
eventName: | ||
$ref: './EventAttributes.yml#/eventName' | ||
eventType: | ||
$ref: './ConversionEvent.yml' | ||
eventSubtype: | ||
$ref: './AddToCartEvent.yml' | ||
index: | ||
$ref: './EventAttributes.yml#/index' | ||
queryID: | ||
$ref: './EventAttributes.yml#/queryID' | ||
objectIDs: | ||
$ref: './EventAttributes.yml#/objectIDs' | ||
objectData: | ||
$ref: './EventAttributes.yml#/objectDataAfterSearchList' | ||
currency: | ||
$ref: './EventAttributes.yml#/currency' | ||
userToken: | ||
$ref: './EventAttributes.yml#/userToken' | ||
timestamp: | ||
$ref: './EventAttributes.yml#/timestamp' | ||
required: | ||
- eventName | ||
- eventType | ||
- eventSubtype | ||
- queryID | ||
- index | ||
- objectIDs | ||
- userToken |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
type: string | ||
enum: [purchase] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
type: object | ||
title: Purchased object IDs | ||
description: | | ||
Use this event to track when users make a purchase unrelated to a previous Algolia request. For example, if you don't use Algolia to build your category pages, use this event. | ||
To track purchase events related to Algolia requests, use the "Purchased object IDs after search" event. | ||
additionalProperties: false | ||
properties: | ||
eventName: | ||
$ref: './EventAttributes.yml#/eventName' | ||
eventType: | ||
$ref: './ConversionEvent.yml' | ||
eventSubtype: | ||
$ref: './PurchaseEvent.yml' | ||
index: | ||
$ref: './EventAttributes.yml#/index' | ||
objectIDs: | ||
$ref: './EventAttributes.yml#/objectIDs' | ||
objectData: | ||
$ref: './EventAttributes.yml#/objectDataList' | ||
currency: | ||
$ref: './EventAttributes.yml#/currency' | ||
userToken: | ||
$ref: './EventAttributes.yml#/userToken' | ||
timestamp: | ||
$ref: './EventAttributes.yml#/timestamp' | ||
required: | ||
- eventName | ||
- eventType | ||
- eventSubtype | ||
- index | ||
- objectIDs | ||
- userToken |
35 changes: 35 additions & 0 deletions
35
specs/insights/common/schemas/PurchasedObjectIDsAfterSearch.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
type: object | ||
title: Purchased object IDs after search | ||
description: | | ||
Use this event to track when users make a purchase after a previous Algolia request. | ||
If you're building your category pages with Algolia, you'll also use this event. | ||
additionalProperties: false | ||
properties: | ||
eventName: | ||
$ref: './EventAttributes.yml#/eventName' | ||
eventType: | ||
$ref: './ConversionEvent.yml' | ||
eventSubtype: | ||
$ref: './PurchaseEvent.yml' | ||
index: | ||
$ref: './EventAttributes.yml#/index' | ||
queryID: | ||
$ref: './EventAttributes.yml#/queryID' | ||
objectIDs: | ||
$ref: './EventAttributes.yml#/objectIDs' | ||
objectData: | ||
$ref: './EventAttributes.yml#/objectDataAfterSearchList' | ||
currency: | ||
$ref: './EventAttributes.yml#/currency' | ||
userToken: | ||
$ref: './EventAttributes.yml#/userToken' | ||
timestamp: | ||
$ref: './EventAttributes.yml#/timestamp' | ||
required: | ||
- eventName | ||
- eventType | ||
- eventSubtype | ||
- queryID | ||
- index | ||
- objectIDs | ||
- userToken |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters