AdForm server side tracking

Hi there, I have problem with setting server side Adform tracking. I migrate tags from browser GTM to server. Remarketing in server GTM is working properly, but conversion in Adform has some error. The tag is fired but it says “Exception thrown” and in Console in sGTM I can read “TypeError: Cannot read properties of null (reading ‘user_agent’)”. All other media tags (FB, GAds) are sending data properly. I am using the Stape template for AdForm. Where can be the problem?

Judging by the error, the value in the user_agent parameter is either missing or incorrect.
Can you check what value you have in event data for user agent?

Hi Alex, I cant see anything strange - in event data I can see ("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36). The information as in other events. What is also strange - in remarketing - in debug, there is no requests visible - no browser or server. I can see only that the tag was fired.

It is normal that there is no outgoing request with page view event type here. In this case the tag only works to set a cookie if the url has the parameter you specify. This tag only sends data on conversion events that you have configured. Almost all tags of affiliate platforms work in a similar way.

Great, but still, where is the problem with conversion what I wrote before?

Can you please show screenshots of the problem and your setup? I think without that it would be difficult to guess what the causes of this might be

Of course. There shouldnt be any problem with trigger as I use it also for another tags and it work well. I have problem only with adform tag. During firing - there is written “exception thrown”. (I cant to send more pictures in 1 post because I am a new user).

Thanks for the details, but can you please also show a screenshot of the ‘user_agent’ parameter from Event Data in preview mode?
The tag also checks the ‘User-Agent’ header of the incoming requester. So you also need to check that as well.

Here you go - “user_agent” from event data where Adform tag conversion is triggered

.

And User_Agent from http incoming request

Thank you!
Looks like the tag doesn’t check the event data itself for some reason, I’ll tell the devs to add it in the next update.
Simple fix for this now you need to add these parameters to the tag manually from event data and everything should work:

Hi Alex, thank you very much. It is working:)

1 Like

Hi Alex, could you please help mi with follow-up topic. The media guy wrote me - “For example, on the page Výhodné nabídky | McDonald's ČR, I was there on Wednesday, but the tracking point in Adform has not been appearing since February 28.” - I have conversion type of AdForm tracking just for downloading the app and then I have “pageView” type that as you wrote just setting the cookie.


Am I am missing something? Is my server set up wrong or is there another problem? Thank you very much, Zuzana

Event type page view only sets the cookie, it doesn’t send any data to Adform, so it’s hard to tell from your screenshot, although it looks correct.

The data attribution works entirely on the Afrom side. sGTM works on the fly, it has no data store and it is technically impossible for data to be delayed somewhere and sent later. So if your conversion events work and are sent, they are further processed on the platform side (Afrom in your case) and displayed there in a processed form according to the settings you use there.

Hi Alex, would it be possible to get more support? Could I get call with some of your speacialist? Best regards, Zuzana

The Stape Agency can help you with consultation on setting up tracking, they have a consultation service there: Server-Side Tracking Agency offers different quotes - Stape

If you’re a Stape customer on an Enterprise or higher plan - you also have a free call with the tracking specialists.