Hello Damon, thank you for your reply.
I did the <!-- templatePlaceholderList --> before searching on your forum. That is where I found the $currentuser.fullname$ and $currentuser.num$ placeholders, which unfortunately change when someone edits the article>
I created a placeholder called ANALYTICS in the accounts section, so that each editor can have a Google Analytics code added to their articles and check their performance, while I can pay them based on the number of visits they generate to our site.
So, $currentuser.analytics$ does kind of work, but not completely:
If user A publishes an article, his Google Analytics is inserted and his visits are counted. BUT! If user B (an admin) edits the article to correct any issue, then the GA code from user A is replaced by the GA code from user B.
I am looking for the correct placeholder to use: instead of 'CURRENTUSER' it should be something like 'ORIGINALUSER'
I already tried guessing dozens of possibilities, including:
- $user.analytics$
- $username.analytics$
- $createdbyuser.analytics$
- $author.analytics$
- etc...
Right now, I have a large If / Then statement at the end of each of my 64 templates, but I'm planning on getting new authors and I can't edit 64 templates each time I add a new person:
<!-- templateIf : $article.createdByUserNum$ eq '30' -->
<!-- Amanda Juarez -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxxx-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-xxxxxxxxx-1');
</script>
<!-- /templateIf -->
<!-- templateIf : $article.createdByUserNum$ eq '34' -->
<!-- Bayron Garcia-->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxxx-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-xxxxxxxxx-2');
</script>
<!-- /templateIf -->
<!-- templateIf : $article.createdByUserNum$ eq '35' -->
<!-- Oscar Estrada -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxxx-3"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-xxxxxxxxx-3');
</script>
<!-- /templateIf -->
<!-- templateIf : $article.createdByUserNum$ eq '38' -->
<!-- Axel Natareno -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxxx-4"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-xxxxxxxxx-4');
</script>
<!-- /templateIf -->
<!-- templateIf : $article.createdByUserNum$ eq '39' -->
<!-- Elsa Robles -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxxx-5"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-xxxxxxxxx-5');
</script>
<!-- /templateIf -->
<!-- templateIf : $article.createdByUserNum$ eq '40' -->
<!-- Pablo Ordoñez -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxxx-6"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-xxxxxxxxx-6');
</script>
<!-- /templateIf -->
<!-- templateIf : $article.createdByUserNum$ eq '41' -->
<!-- Ana Lucia Jimenez -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxxx-7"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-xxxxxxxxx-7');
</script>
<!-- /templateIf -->
<!-- templateIf : $article.createdByUserNum$ eq '42' -->
<!-- Alex Castillo -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxxx-8"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-xxxxxxxxx-8');
</script>
<!-- /templateIf -->
<!-- templateIf : $article.createdByUserNum$ eq '43' -->
<!-- Yasmin Salguero -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxxx-9"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-xxxxxxxxx-9');
</script>
<!-- /templateIf -->
An alternative would be to be able to somehow INCLUDE the above code with a <!--#include virtual="/authors.htm" --> file able to determine which author's GA code it has to place in the page (inserting the above code and calling it via <!--#include virtual="/authors.htm" --> inserts every author's code into every page, so it counts each visit to every page as a visit to each author)
Sven Sanchez
www.deguate.com