Products variable implementation in AEP mobile SDK
Hi,
I am trying to implement products Variable/Event using AEP mobile SDK. Could anyone Please suggest possible implementation ways?
Hi,
I am trying to implement products Variable/Event using AEP mobile SDK. Could anyone Please suggest possible implementation ways?
Sure, I can help you with that. Here are some possible implementation ways for products Variable/Event using AEP mobile SDK for Adobe Analytics:
To implement this, you would need to create a new ProductVariable object and set the product name, price, and quantity. You would then need to call the track() method to track the product variable.
// Create a new ProductVariable object
ProductVariable productVariable = new ProductVariable();
// Set the product name
productVariable.setName("Product Name");
// Set the product price
productVariable.setPrice(100);
// Set the product quantity
productVariable.setQuantity(1);
// Track the product variable
productVariable.track();To implement this, you would need to create a new ProductEvent object and set the product name, event type, and event properties. You would then need to call the track() method to track the product event.
// Create a new ProductEvent object
ProductEvent productEvent = new ProductEvent();
// Set the product name
productEvent.setName("Product Name");
// Set the event type
productEvent.setEventType("Product Added to Cart");
// Set the event properties
productEvent.setProperty("Quantity", 1);
// Track the product event
productEvent.track();To implement this, you would need to create a new ProductDataLayer object and set the product data and events. You would then need to call the push() method to push the product data and events to the GTM Data Layer.
// Create a new ProductDataLayer object
ProductDataLayer productDataLayer = new ProductDataLayer();
// Set the product data
productDataLayer.setProductName("Product Name");
productDataLayer.setProductPrice(100);
productDataLayer.setProductQuantity(1);
// Set the product events
productDataLayer.setProductEventType("Product Added to Cart");
productDataLayer.setProperty("Quantity", 1);
// Push the product data and events to the GTM Data Layer
productDataLayer.push();I hope this helps! Let me know if you have any other questions.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.