Customdimension renames everytime

Hey there,

I want to track a specefic dimension with specific name.
I am trying to use the customDimension for the js tracker like this:

    _paq.push(['setCustomDimension', customDimensionId = 312, customDimensionValue = 'uniqName']);
    _paq.push(['trackPageView']);

When I check the analytics I can see the ‘uniqName’ is created inside Dimension 3 but when the page reloads with another name it renamed the previous record instead of creating a new one. How can I achieve this?

Thank in advance.

PS: Is this the correct way to use the http API to get the stats from that customDimensionValue?

        $url .= "?module=API&method=API.getBulkRequest&format=XML&";
        $url .= "urls[0]=method=CustomDimensions.getCustomDimension&idDimension=312&idSite=432&date=2018-08-28&period=day&segment=uniqName";
        $url .= "&token_auth=xxxxxxx";