「フロー」→「データ値の変更」で、データ値に日付(yymmdd)を挿入したい | Community
Skip to main content
New Participant
July 27, 2021
Question

「フロー」→「データ値の変更」で、データ値に日付(yymmdd)を挿入したい

  • July 27, 2021
  • 1 reply
  • 3347 views

お世話になります。

 

現在、弊社では、MarketoEngageからLINEAPIを呼び出し、LINEメッセージを配信しています。

配信しているLINEメッセージはイメージマップで、それに使用する商品の画像は外部サービスを通して出力しています。

 

外部サービス(レコメンドエンジン)を呼び出すURLは毎回リード毎に同一のもので、呼び出したその時点の最適な商品をレスポンスしてくれます。

例:https://hogefugajp-recommend/?xxx=yyy&aaa=bbb&ccc={{lead.userSeq}}&…… 

「フロー」→「データ値の変更」を使用し、上記のようなリード毎のURLをカスタムフィールドに設定、そのカスタムフィールドをLINEAPI呼び出し時に使用しています。

 

ここで、LINE配信自体は成功したのですが、「ユーザ毎に、毎回全く同じ商品の画像が送信されている」ことが発覚しました。

外部サービスに問い合わせると、MarketoEngageから呼び出しているLINEAPIの回数よりも、外部サービスが呼び出された回数がはるかに少なく、状況から「URLが同一の為LINEでキャッシュし、LINEAPI呼び出しの度にキャッシュした画像を表示している」可能性が高そうでした。

 

HTTPHeaderに「Cache-Control: no-store」を設定してもキャッシュされてしまったので、外部サービス(レコメンドエンジン)を呼び出すURLのクエリストリングの中に「日付」(yymmdd)を入れよう、と考えました。

例:https://hogefugajp-recommend/?xxx=yyy&aaa=bbb _yymmdd&ccc={{lead.userSeq}}&…… 

 

ただ、「データ値の変更」だとスクリプトトークンが使用できず(スクリプトそのものが出力されてしまいました)、システムトークンだと空白があったり、記号が含まれてしまったり、上手くいきません。

以前、こちらのサイトで、システムトークンの形式は変更できない、という回答を見たことがあります。

データ値に日付(yymmdd)を挿入することは諦めたほうがいいでしょうか?

 

みなさまのお知恵を拝借したく、どうぞよろしくお願いいたします。

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

SanfordWhiteman
New Participant
July 27, 2021

[Using Google Translate, hope this works.]

 

The only character in the token {{system.datetime}} that technically needs to be URL-encoded is the space between the date and the time.

 

Marketo encodes the space as well as the colon characters (even though a plain : is allowed in the query string).

 

So if you add ts={{system.datetime}} to the query string, that creates a unique URL. If the remote service still returns cached data, that’s a problem on the remote end.

New Participant
July 29, 2021

Thank you for your answer.

 

I tried  to add ts={{system.datetime}} to the query string, but LINE API Server returned code 400.

 

Error:

{"message":"The request body has 1 error(s)","details":[{"message":"Must be a valid HTTPS URL","property":"messages[0].baseUrl"}]}

 

I think that the space is not allowed in LINE API Request.

And, it’s revealed that the remote service doesn't tolerate the colon characters.

The remote service allows the hyphen and the underscore.

 

Thanks.

SanfordWhiteman
New Participant
July 29, 2021

I think that the space is not allowed in LINE API Request.

And, it’s revealed that the remote service doesn't tolerate the colon characters.

The remote service allows the hyphen and the underscore.


Broken parser, they shouldn’t say “valid URL“ if they actually mean “we have some private rules that don’t relate to the URL standard.“ 🙂

 

I think your only choice now will be to use another webhook to fetch some unique string into a lead field, then pass that {{lead.token}} to the LINE API.  Marketo doesn’t have anything like a {{system.randomvalue}} token built in.