Expand my Community achievements bar.

SOLVED

previous product id

Avatar

Level 1

We need to capture product id of the original page the product was viewed. So at product display page, we have "you may also like & complete you look". buckets.

now when user come to product A page, he see both of any buckets and he click any product from that buckets. So requirement is we need to have previous product id when user land to page B , we store should a eVar with previous product id values.

As of now what I have done is

I used a session storage DE and stored that value in the Product display page rule if the product being viewed(page A) has items displayed in any of these buckets.

Note: the value is only applicable on the very next page after it's been set. this is where I am thinking how to do.

 

we should be setting the DE when the user views product A(this is being done),

Need guidance - sending that value in eVarX when they land on product B and then immediately emptying the DE. When the user goes to product C, we send nothing in eVarX (the DE will be empty), then we set the DE again since we are displaying buckets.

Do I need to create a different rule in order to send the var in next page?

@AdobeLaunchUser1 @analytics @ADOBEANALYTICS 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

No, you do not need to create a different rule in order to send the variable in the next page. You can use the same rule to send the variable in the next page and empty the DE.

To do this, you will need to add a condition to the rule that checks if the current page is product B. If the current page is product B, then the rule will send the value of the DE in eVarX.

You will also need to add an action to the rule that empties the DE. This will ensure that the value of the DE is not carried over to the next page.

Here is an example of the rule that you can use:

Trigger: Pageview
Conditions:
* Page URL matches /product-a/
* Product ID is present in the URL
Actions:
* Set DE to Product ID
* Send DE in eVarX
* Empty DE

 

This rule will set the DE to the product ID of the product that the user is viewing on product A. It will then send the value of the DE in eVarX when the user lands on product B. Finally, it will empty the DE so that the value is not carried over to the next page.

You can also use this same approach to send the value of the DE in eVarX when the user lands on product C. Simply add a condition to the rule that checks if the current page is product C. If the current page is product C, then the rule will send the value of the DE in eVarX.

By following these steps, you can capture the product ID of the original page the product was viewed and send it in eVarX when the user lands on the next page.

 

 

View solution in original post

5 Replies

Avatar

Correct answer by
Community Advisor

No, you do not need to create a different rule in order to send the variable in the next page. You can use the same rule to send the variable in the next page and empty the DE.

To do this, you will need to add a condition to the rule that checks if the current page is product B. If the current page is product B, then the rule will send the value of the DE in eVarX.

You will also need to add an action to the rule that empties the DE. This will ensure that the value of the DE is not carried over to the next page.

Here is an example of the rule that you can use:

Trigger: Pageview
Conditions:
* Page URL matches /product-a/
* Product ID is present in the URL
Actions:
* Set DE to Product ID
* Send DE in eVarX
* Empty DE

 

This rule will set the DE to the product ID of the product that the user is viewing on product A. It will then send the value of the DE in eVarX when the user lands on product B. Finally, it will empty the DE so that the value is not carried over to the next page.

You can also use this same approach to send the value of the DE in eVarX when the user lands on product C. Simply add a condition to the rule that checks if the current page is product C. If the current page is product C, then the rule will send the value of the DE in eVarX.

By following these steps, you can capture the product ID of the original page the product was viewed and send it in eVarX when the user lands on the next page.

 

 

Avatar

Level 1

Hi, @Hemang35 

 

I have gone through your mentioned solutions, but let me put down

At present we have existing product display page rule(while fires in every product a user views) , event -Data element change -> PageName

condition-> pageType is product (data layer)

action-> set variable (set product data).

 

So how do I add these new changes to the existing rule, also there can be many page where we will have those buckets, so I cannot mention page b,c separate every time in condition right?

Avatar

Community Advisor

Sure, I can help you with that.

To add new changes to an existing rule in Adobe Analytics, you can use the Rule Editor. To open the Rule Editor, go to Admin > Rules.

Once the Rule Editor is open, find the rule that you want to add the new changes to. Then, click on the Edit button.

In the Rule Editor, you will see the following sections:

  • Trigger: The trigger that the rule will be applied to.
  • Conditions: The conditions that the rule will be evaluated against.
  • Actions: The actions that will be taken when the rule is triggered.

To add a new condition to the rule, click on the Add Condition button. This will open a new dialog box where you can specify the new condition.

In the new dialog box, you will need to specify the following:

  • Operator: The operator that will be used to evaluate the condition.
  • Value: The value that the condition will be evaluated against.

Once you have specified the new condition, click on the Save button. The new condition will be added to the rule.

To add a new action to the rule, click on the Add Action button. This will open a new dialog box where you can specify the new action.

In the new dialog box, you will need to specify the following:

  • Action: The action that will be taken when the rule is triggered.
  • Parameters: The parameters that the action will take.

Once you have specified the new action, click on the Save button. The new action will be added to the rule.

In your case, you can use the AND operator to combine the existing condition with the new condition. The new condition will check if the current page is one of the pages that contains the buckets. The following code shows how to do this:

(pageType is product) AND (pageName in ("/product-a/", "/product-b/", "/product-c/"))

This rule will fire when the user views a product page and the current page is one of the pages that contains the buckets.

You can also use the Custom Function to add a complex condition to a rule. To do this, click on the Add Custom Function button in the Rule Editor. This will open a new dialog box where you can specify the custom function.

In the new dialog box, you will need to specify the following:

  • Name: The name of the custom function.
  • Parameters: The parameters that the custom function will take.
  • Body: The body of the custom function.

Once you have specified the custom function, click on the Save button. The custom function will be added to the rule and you can use it to evaluate the condition.

I hope this helps! Let me know if you have any other questions.



Avatar

Level 1

Hi @Hemang35 

 

Thanks for your quick response, I know how to add condition or action my concern why what I should add.

So above condition what you mentioned will impact the rule due to "and" as we add in condition. product display page load rule have to fire irrespective of  bucket is there or not. 

My request is additional, if we see buckets then we add in a new eVar in next page with previous product id value.

 

Avatar

Community Advisor

Thanks for the clarification. It sounds like you want the rule to fire on the product display page regardless of whether a specific condition (i.e., the presence of 'buckets') is met. If 'buckets' is present, you would then like to set an eVar with the previous product ID value on the next page.

In this scenario, you might consider creating two separate rules in Adobe Launch:

  1. The first rule, "Product Display Page Load", should be set to always fire when a user lands on a product display page. You can use the "Path" condition to check if the user is on a product page and then perform the actions you want to happen on every product page.

  2. The second rule, "Bucket Exists", can be set to fire only if 'buckets' is present. For the condition, you could use a custom condition where you check for the presence of 'buckets'. If the condition is met, the action would be to set the eVar with the previous product ID on the next page.

This way, you can ensure that your rule for the product display page load always fires, while the setting of the eVar only happens if 'buckets' is present.

Remember, your conditions and actions will be dependent on how you have structured your data layer or how you're tracking your 'buckets' and product IDs. Please adjust the solution based on your specific implementation.