Expand my Community achievements bar.

SOLVED

How to track a custom variable

Avatar

Level 2

How do we track a custom variable?

In summary, we have a form on our website and when someone completes the form they receive a unique quote number. It is this unique quote number that we use to create a custom variable. If the customer returns to the site they input this unique quote number to show their details. The customer may return on more than one occasion (sometimes on the same day, sometimes on multiple days) and input their quote number.

We need to identify the first time/date the customer received this quote number, if this is possible?

tx

Jon

1 Accepted Solution

Avatar

Correct answer by
Level 10

HI Jon,

Are you using DTM on your site? If so, you can create a data element that uses a CCS selector or JSON to retrieve the value from the page. You would want to also create an event-based rule that is triggered when the forum is submitted. That way the data element would be called when the forum is submitted and the value would then be stored in the data element for use in whatever call/code you'd like. 

As for the date, there are a few options. I believe in Analytics you can set up your variable to keep track of the first value it received for each user. Another option would be to use some Javascript or a plugin to generate a time/date stamp at the time of the forum submission (this could be placed in the custom code section of the event-based rule). Once you've got the timestamp, you would have to decide if you wanted to include that in the same variable with the quote number or use a different variable for this.

let me know if I can provide additional details or clarification.

 

Thanks,
Jantzen

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

HI Jon,

Are you using DTM on your site? If so, you can create a data element that uses a CCS selector or JSON to retrieve the value from the page. You would want to also create an event-based rule that is triggered when the forum is submitted. That way the data element would be called when the forum is submitted and the value would then be stored in the data element for use in whatever call/code you'd like. 

As for the date, there are a few options. I believe in Analytics you can set up your variable to keep track of the first value it received for each user. Another option would be to use some Javascript or a plugin to generate a time/date stamp at the time of the forum submission (this could be placed in the custom code section of the event-based rule). Once you've got the timestamp, you would have to decide if you wanted to include that in the same variable with the quote number or use a different variable for this.

let me know if I can provide additional details or clarification.

 

Thanks,
Jantzen

Avatar

Level 2

Many thanks Jantzen,

We've now resolved this by using a combination of Dimension, Segment and Metric to obtain this data.

Thanks again,

Jon