Attach attributes to the generic script tag

Gold Contributor
Gold Contributor

Hi there,
simple question :

It's possible to insert a variable as a parameter of base url in Generic Tag? Not as a query string and not editing the template.

If i used @@variable@@ it returns a variable like query string

I would like something like this: 
site.com/v1/tag/@@variable@@/

Thanks in advance

6 REPLIES 6

Attach attributes to the generic script tag

Community Manager
Community Manager

@die_rnd From the docs:

This tag supports dynamic value substitution, which allows you to reference data layer variables directly in the Base URL, HTTPS URL, or Query String configuration fields.

https://community.tealiumiq.com/t5/iQ-Tag-Management/Tealium-Generic-Tag/ta-p/12034#toc-hId-16127726...

Remember to "Accept as Solution" when your question has been answered and to give kudos to helpful replies.

Attach attributes to the generic script tag

Gold Contributor
Gold Contributor

Hi @TealiumJustin thanks for the answer!

I had read the documentation but if i use my variable surrounded by @@ it returns a query string in my base url.

Instead using attribute as a prefix it an empty string. Like this:

empty.PNG

Attach attributes to the generic script tag

Gold Contributor
Gold Contributor

Well, I removed the mapping.
I added a udo variable js_page.id_tag and added in the base url of the configuration tag @@js_page.id_tag@@

Works!

Attach attributes to the generic script tag

Community Manager
Community Manager

@die_rnd All data mappings are added as query string parameters. Your first configuration was correct, but because the variable was also mapped, it appeared in the query string. I updated the documentation to clarify the behavior of mappings.

Remember to "Accept as Solution" when your question has been answered and to give kudos to helpful replies.

Attach attributes to the generic script tag

Gold Contributor
Gold Contributor
Thanks Justin!

Last question :
my id on the base url is correct, but without the /.
if I add a variable now, is the / sign added automatically?

Attach attributes to the generic script tag

Gold Contributor
Gold Contributor

Hi @TealiumJustin i have another doubt!

I had to change the type of extension. Now the situation is this :

  • Tag configuration with base url "url.../@@js_page.idbaseurl@@/;
  • UDO variable named js_page.idbaseurl;
  • Advanced javascript code that return the b.js_page.idbaseurl(my id) filled by function;
  • There aren't variable mapped;


So, i have solved removing the prefix js_page on tag configuration and renaming the variable.

Sorry @TealiumJustin for numerous answers, so i hope it will help for everyone.

Thank you

Public