gtm-module icon indicating copy to clipboard operation
gtm-module copied to clipboard

Defining campaign specific ID?

Open christofferjjohansen opened this issue 5 years ago • 2 comments
trafficstars

This feels like a silly question, with an easy answer, but I simply can't find it anywhere.

In short, we have our Google tag manager ID, which is in the init, now when we're triggering events, we want them to point back to a specific campaign.

This is the specific code snippet Google gives me.

gtag('event', 'conversion', {'send_to': 'GTM_ID/gOBDCMmXXXXXX-XX' });

From the Readme; I assume this.$gtm.push({ event: 'myEvent', ...someAttributes }) the someAttributes is where this information will go? I can find no mention of an Ad_id, campaign_id, etc anywhere. Help would be much appreciated.

christofferjjohansen avatar Nov 24 '20 05:11 christofferjjohansen

I think it should be:

this.$gtm.push({event: "conversion", send_to: "GTM_ID/gOBDCMmXXXXXX-XX" });

But I'm not sure if attributes should be other object or just comma separated.

Give a try.

jonalxh avatar Nov 25 '20 16:11 jonalxh

As mentioned here: "https://developers.google.com/tag-manager/devguide" it should be comma separated.

So it should work as @jonalxh wrote. (i'm just facing the same problem)

prinzt avatar Dec 09 '20 09:12 prinzt