Array
Intermediate

Divide value by number

This one is pretty simple but useful! Your GTM variable is split by a set number and output this.

Usecase

This macro can come in handy when you need to split a conversion value or any other number.

Instructions

  • Replace {{var_value}} by a variable in your GTM container. Please note that this should be only numbers.
  • Replace the ‘2’ with a number you want to divide it by.
JavaScript

// Input example: 10
// Output example: 5

function () {
    return {{var_value}} / 2;
}

Isn’t this the macro you were looking for? Check-out related macro’s below or request one.

Related macros

All macro’s

Capture UTM parameters and save them into separate cookies

Array
Intermediate

Capture UTM parameters

Array
Intermediate

Form field value

Array
Intermediate