11

I'm not talking about copying (i.e. importing/exporting, which requires replacing all of the website's tracking codes) but about cases when a container was opened in the wrong account and/or when a merge is required.

Is it possible?

1
  • 1
    Great question @LWC. I wanted to know the same thing. Commented Apr 21, 2016 at 17:25

3 Answers 3

9

After wishing I could do the same and researching it, I have found the answer to be: No.

You can import and export, but you cannot modify the common GTM ID (ie. GTM-XXXXXX), and since you must import into an existing container, whatever you import is associated with that container ID.

It would be very nice to be able to move these around, but I'm sure the reason for not allowing it is that Accounts might be owned and managed by different companies or users, and moving containers between such environments could become very complicated just in terms of permission.

1
  • Thanks @AndrewHoyer. I was looking for this very same Q&A. Commented Apr 21, 2016 at 17:24
2

Yes, you can.

On the new account make a container, note it's id (GTM-XXXXX)

Export the container from the old account. Then open the JSON in a text editor, find and replace all instances of the old id with the new one from the new account.

Next, find and replace all instances of accountId and containerId to the new account's id and the new container's id (these can be found in the URL when you are logged in to the new account and viewing the container)

Then save the JSON and import

1
  • 3
    How is it different from "importing/exporting, which requires replacing all of the website's tracking codes"? Wouldn't the importing process already replace the IDs on its own?
    – LWC
    Commented May 11, 2018 at 9:40
0

I know this answer comes way too late to be helpful to the OP, but I came across this question while I was hunting for the same, and thought it would help other readers to know, that Simo Ahava has actually created a solution...

https://www.simoahava.com/analytics/introducing-gtm-tools/

1
  • Better late that never. But while it may does it quicker and easier, is it not the same as "importing/exporting, which requires replacing all of the website's tracking codes"?
    – LWC
    Commented May 19, 2019 at 19:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.